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

GridGroupingControl: grouped columns state

I''m using GridGroupingControl to which i bind a BindingList. It is then grouped by several columns. The question i have is how to preserve the state of the grouped columns (ie whether they are expanded or collapsed) when i refresh the list? Thanks in advance

2 Replies

AD Administrator Syncfusion Team June 29, 2006 04:30 PM UTC

Hi Golovkine, You can use the GroupExpanded and GroupCollapsed events to save the status ( i.e., expanded or collapsed ) by saving the record index in a hashtable before the change. And after the change the list( i.e., Rows or columns added ), you could try expanding the required records depend on the mappings in the hashtable. You can expand or collapse a particular Group by using this code snippet this.gridGroupingControl1.Table.Records[5].ParentGroup.IsExpanded = true; In order to access a particular group record, you can follow this sample code snippet. int cnt = this.gridGroupingControl1.Table.TopLevelGroup.Groups["row6 col1"].Records.Count; Record f = this.gridGroupingControl1.Table.TopLevelGroup.Groups["row6 col1"].Records[0]; Record l = this.gridGroupingControl1.Table.TopLevelGroup.Groups["row6 col1"].Records[cnt-1]; For more details, please refer to our Evalution center http://www.syncfusion.com/support/EvaluationCenter/default.aspx?cNode=5 =>GridGroupingControl Groups & Records Let us know if this helps Regards, Haneef


IG Ilya Golovkine June 30, 2006 09:26 AM UTC

Thanks a lot that works >Hi Golovkine, > >You can use the GroupExpanded and GroupCollapsed events to save the status ( i.e., expanded or collapsed ) by saving the record index in a hashtable before the change. And after the change the list( i.e., Rows or columns added ), you could try expanding the required records depend on the mappings in the hashtable. > >You can expand or collapse a particular Group by using this code snippet > >this.gridGroupingControl1.Table.Records[5].ParentGroup.IsExpanded = true; > >In order to access a particular group record, you can follow this sample code snippet. > >int cnt = this.gridGroupingControl1.Table.TopLevelGroup.Groups["row6 col1"].Records.Count; >Record f = this.gridGroupingControl1.Table.TopLevelGroup.Groups["row6 col1"].Records[0]; >Record l = this.gridGroupingControl1.Table.TopLevelGroup.Groups["row6 col1"].Records[cnt-1]; > >For more details, please refer to our Evalution center http://www.syncfusion.com/support/EvaluationCenter/default.aspx?cNode=5 =>GridGroupingControl Groups & Records > >Let us know if this helps >Regards, >Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon