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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Save and Restore visible cells in a gridGroupingControl

Thread ID:





75191 Jul 15,2008 06:43 PM UTC Mar 21,2018 04:36 PM UTC WinForms 5
Tags: GridControl
Administrator [Syncfusion]
Asked On July 15, 2008 06:43 PM UTC


I am using a gridGroupingControl. I would like have some kind of way in which I can get the list of rows that are currently visible by the user, and then at a later time restore them.

Here is the situation. In my app, there are cases where the DataSource for the grid needs to be refreshed. After refreshing the datatable, we reset the datasource for the grid. However, when this occurs, the display scrolls up to the first row. I would like to make it so we can move back to the row that the user was previously looking at.


Sri Rajan [Syncfusion]
Replied On July 16, 2008 08:53 AM UTC

Hi Michael,

Thank you for your interest in Syncfusion products.

The GridGroupingControl retains the selections normally. Please refer the below sample in which GridGroupingControl retains the selection in the recently visible row eventhough new rows are added in the datatable.


Please let me know if this helps.

Best Regards,

Administrator [Syncfusion]
Replied On July 16, 2008 01:25 PM UTC

It looks like i figured out the issue:

I wanted the ability to preserve the expanded groups before and after the refresh. For some reason, if I first refreshed the Grid, and then looped through all of the top level groups and only expanded the previously open ones, this situation occurred.

However, if I moved the refresh and the expansion of the groups into one step, and enclosed them in a grid.BeginUpdate() and grid.EndUpdate() block, the screen position was maintained, and the previously expanded groups were restored.

Sri Rajan [Syncfusion]
Replied On July 17, 2008 11:10 AM UTC

Hi Michael,

Thank you for your Update.

You can also preserve the expanded groups using serialization concept.Please refer the below browser sample for more details.

Grid.Grouping Samples--->Serialization--->XML Serialization

Path In Disc:
\My Documents\Syncfusion\EssentialStudio\{Version Number}\Windows\Grid.Grouping.Windows\Samples\2.0\Serialization\XML Serialization

Please let me know if this helps.

Best Regards,

Marcus Benz
Replied On March 20, 2018 10:53 AM UTC


the example is not available.


Sindhu Nagarajan [Syncfusion]
Replied On March 21, 2018 04:36 PM UTC

Hi Marcus, 
Thanks for the update.  
GridGroupingControl does not have direct support to serialize/de-serialize the record selection state. It can be achieved by creating custom class to hold the information of the selected record state. Please refer to the below  code and sample, 
Code Example 
private void serializeBtn_Click(object sender, EventArgs e) 
    //To serialize the selected record 
    List<GroupExpandState> groupExpandState = new List<GroupExpandState>(); 
    List<RecordSelectionState> recordSelectionState = new List<RecordSelectionState>();     
    foreach (SelectedRecord record in this.gridGroupingControl1.Table.SelectedRecords) 
        recordSelectionState.Add(new RecordSelectionState() { RecordIdentifier = this.gridGroupingControl1.Table.Records.IndexOf(record.Record), IsSelected = true }); 
    XmlSerializer serializer1 = new XmlSerializer(typeof(List<RecordSelectionState>)); 
    serializer.Serialize(xw, groupExpandState); 
    serializer1.Serialize(xw1, recordSelectionState); 
private void deSeralizeBtn_Click(object sender, EventArgs e) 
     // To deserialize the selected record 
     XmlReader xr1 = new XmlTextReader("RecordSelectionState.xml"); 
     XmlSerializer serializer1 = new XmlSerializer(typeof(List<RecordSelectionState>)); 
     List<RecordSelectionState> selectionState = serializer1.Deserialize(xr1) as List<RecordSelectionState>;     
     foreach (RecordSelectionState recordSelectionState in selectionState) 
Please refer to the dashboard sample available in your local machine 
<Installed Location>\Syncfusion\EssentialStudio\<Version number>\Windows\Grid.Grouping.Windows\Samples\Serialization\XML Serialization Demo\CS 
Please let us know your exact scenario so that solution can be provided at earliest. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon