Posted 13 February 2026, 1:44 pm EST
Hello,
I have flexgrid and transposed grid, both in its own ngIf, toggled by clicking the button
They both share the same data source.
When I switch from grid to transposed - I get error: ERROR TypeError: Cannot read properties of null (reading ‘hasColumnGroups’), and for example filter stops working in transposed grid etc.
It didnt use to behave like that.
I think it is happening since we have updated out versions of Angular etc.
What could be the problem? And solution?
public toggleTransposedGrid(): void { this.dbgClassic.currentRowCol = { row: this.currentGrid.selection.row, col: this.currentGrid.selection.col }; this.dbgClassic.showTransposedGrid = !this.dbgClassic.showTransposedGrid; }
Base Class of both flexgrid and transposed grid:
public ngOnDestroy(): void {
this.subscription.unsubscribe();
this.wjGridFilter && this.wjGridFilter.filterApplied.removeHandler(this.onFilterApplied); this.wjGridFilter && this.wjGridFilter.filterChanged.removeHandler(this.onFilterChanged); this.dataSrc.collectionChanged.removeHandler(this.onCollectionChanged); this.dataSrc && this.dataSrc.collectionChanged.removeHandler(this.onCollectionChanged); this.slideshowIntervalPromise && clearInterval(this.slideshowIntervalPromise); }
Flexgrid class:
public ngOnDestroy(): void {
super.ngOnDestroy();
this.flexGrid.selectionChanging.removeAllHandlers(); this.flexGrid.selectionChanged.removeAllHandlers(); this.flexGrid.scrollPositionChanged.removeAllHandlers(); this.dataSrc.groupDescriptions.collectionChanged.removeHandler(this.onGroupDescriptionsCollectionChanged); this.flexGrid.resizedColumn.removeAllHandlers(); this.flexGrid.updatedLayout.removeAllHandlers(); if (this.gridHostElement) { this.gridHostElement.removeEventListener('keydown', this.onKeydown); this.gridHostElement.removeEventListener('keyup', this.onKeyup); } }
Transposed class:
public ngOnInit(): void { this.currentGrid = this.transposedGrid; super.ngOnInit(); } public ngAfterViewInit() { this.transposedGrid.columns.defaultSize = this.globalService.isMobile ? 150 : Enumerable.From(this.tableSettings.Fields).Max((item: Field) => { return item.sirina }); this.gridHostElement = this.transposedGrid.hostElement; this.dbgClassic.currentRowCol && this.currentGrid.select(this.dbgClassic.currentRowCol.col, this.dbgClassic.currentRowCol.row); this.dbgClassic.currentRowCol = undefined; } public onCollectionChanged = (e: any, args: any) => { this.forceRefreshGridDisplay(); } private forceRefreshGridDisplay(): void { //To achieve the required functionality you may handle the collectionChanged event and update the itemsSource of the transposed grid inside the handler. (https://www.grapecity.com/forums/wijmo/transposed-grid---filter-d) this.transposedGrid.itemsSource = null; this.transposedGrid.itemsSource = this.dataSrc; this.transposedGrid.invalidate(); }
Best regards,
Mary
