It depends what exactly you are doing when you "refresh" the grid. It sounds like whatever you are doing is causing your DataSource to send a Reset notification. That means that the data has been completely recreated. So the grid throws away all rows and columns and re-creates everything from scratch - so the rows cannot maintain their original state like selection or expansion.
The best thing to do is not cause a reset notification. There may be a better way for you to update your data.
The alternative would be for you to store the states of each row yourself. You can't store the row object itself, because once the reset occurs, the old rows are thrown away and new ones are created. So you would have to store the expanded state of each row based on the data in that row - perhap using the primary key.
It is not a property on the UltraDataSource. It's just a technique for loading the data using certain events. Check out the Million rows sample either in the UltraDataSource samples or the WinGrid SamplesExplorer.
I had the same problem, then I realized that I had saved the state as GroupByRowInitialExpansionState.Expanded in the form layout. Double check and see if you are not doing something similar.
Hi Al,
I don't think this is the same issue. There is no notificaiton from the data source that I know of that would cause all of the rows to expand.
Are you sure something in your code isn't expanding all the rows?
Can you duplicate this behavior in a small sample project? If so, you should Submit an incident to Infragistics Developer Support so they can check it out and see why it's happening.
I have a similar issue with the Grid (v7.2.20072.61), though in my scenario the grid does not Collapse, it Expands (i.e. I see many rows across all group-levels).
When the grid is grouped by, say, a column named "Category", and a new row which belongs to a previously unreferenced "Category" is added to the bound UltraDataSource I would expect to see the new grid row created in a new group for that "Category" (which I do see) but I would not expect each and every existing group to be fully "Expanded" as this happens. I presume this relates to some kind of Rebuild / Reset notification (which you aluded to earlier), causing the entire set of data to be re-rendered.
Regardless, is there any way of suppressing or controlling this behaviour so the grid retains it's visual state during this operation? Alternatively, is there an event I can subscribe so I know when the "Reset" operation is happening and can attempt to address this in my own code?
Many thanksAl
A sample of what, exactly? I gave you the line of code that will refresh the grid data.
You mean a sample of using the UltraDataSource as an intermediary? The closest thing is the Million Rows sample which uses the UltraDataSource to display a grid with a million rows.