We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridGroupingControl - How to hide a row in GGC

Hi! Please can anybody tell me how to hide a row in a GGC? In the attached file you can see GGC with several groups. If a group is expanded you can see that the first row contains the same data as the caption row. Now I''d like to hide that row with similar data. Right now I do it like this: private void Table_GroupExpanded(object sender, GroupEventArgs e) { Group group = e.Group; GridRangeInfo gri = this.gridGroupingControlMarketData.TableModel.RecordFieldToRangeInfo( group.GetFirstRecord(), "Symbol" ); int rowIdx = gri.Top; if ( group.Records.Count > 0 ) { HideDuplicatedRow( rowIdx, true ); } } private void HideDuplicatedRow( int rowIdx, bool hide ) { GridModelHideRowColsIndexer indexer = this.gridGroupingControlMarketData.TableModel.HideRows; indexer.SetRange( rowIdx, rowIdx, hide ); } The problem is if I start at the bottom to expand the groups it hides the wrong rowa. If I begin at the top of the table it works. Thank you for your help! Dan groupinggrid_4548.zip

1 Reply

AD Administrator Syncfusion Team July 12, 2005 09:59 PM UTC

Hi Dan, check out the Grid\Samples\Grouping\ResizableRows example that ships with 3.2.1.0 This sample allows you to manually change the size of a row. So, what you could do is set the height of the first row in a group to 0. TableModel.HideRows will not work since that bypasses the CounterLogic used by the grouping engine and you therefore would get drawing and scrolling issues. Stefan >Hi! > >Please can anybody tell me how to hide a row in a GGC? In the attached file you can see GGC with several groups. If a group is expanded you can see that the first row contains the same data as the caption row. Now I''d like to hide that row with similar data. > >Right now I do it like this: > private void Table_GroupExpanded(object sender, GroupEventArgs e) { > Group group = e.Group; > > GridRangeInfo gri = this.gridGroupingControlMarketData.TableModel.RecordFieldToRangeInfo( group.GetFirstRecord(), "Symbol" ); > > int rowIdx = gri.Top; > > if ( group.Records.Count > 0 ) { > HideDuplicatedRow( rowIdx, true ); > } > } > > private void HideDuplicatedRow( int rowIdx, bool hide ) { > GridModelHideRowColsIndexer indexer = this.gridGroupingControlMarketData.TableModel.HideRows; > indexer.SetRange( rowIdx, rowIdx, hide ); > } > >The problem is if I start at the bottom to expand the groups it hides the wrong rowa. If I begin at the top of the table it works. > >Thank you for your help! >Dan > >groupinggrid_4548.zip > >

Loader.
Live Chat Icon For mobile
Up arrow icon