KB Article A2161
Visible to All Users

How to preserve the XtraGrid View state

Description:
When I refresh data in the grid, all the group rows which were previously expanded are collapsed by the grid. Is it possible to workaround this problem?

Answer:
Yes, it is possible. We have created a sample project which allows you to save/load the groups and master rows expansion state, selection, focused row and position of the focused row. We hope it will be helpful to you.
Note You may wish to store the expanded/selected rows in a file or a database. To implement this feature, please write methods to save and restore row lists of the RefreshHelper class.
See Also:
How to preserve the expanded state of TreeList nodes when refreshing data

Show previous comments (15)
Nadezhda (DevExpress Support) 5 years ago

    Hello,

    I've created a separate ticket on your behalf (T904238: How to use the RefreshHelperClass in the latest version). It has been placed in our processing queue and will be answered shortly.

      Hello,

      which events do I have to use when I want to use the RefreshHelper class with the normal DevExpress Refresh Button?

      I use the View.ObjectSpace.Refreshing event to call the RefreshHelper.SaveExpansionViewInfo Method which works fine and stores the expanded rows in the arrayList.

      But what event can I use to call the RefreshHelper.LoadExpansionViewInfo?

      I have tried View.ObjectSpace.Reloaded event and View.CollectionSource.CollectionChanged event which both did not work.

      Thanks for your help!

      DevExpress Support Team 4 years ago

        Hello,

        In order not to mix several questions in one thread, I have created a separate ticket on your behalf: T1006659: What event should I use to load the previously saved GridControl's state. We placed it in our processing queue and will process it shortly.

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.