Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
On refresh, how to retain the grid rows expanded state?
posted

In UltraWinGrid, the grouped rows are expanded using expand symbol (+). On grid refresh, again the rows are getting collapsed. How to retain the expanded state? (Note: Grouping is done based on multiple columns). While refreshing the grid (to reflected the newly added rows or any updates), i tried to use "Grid.Rows.Refresh(RefreshRow.ReloadData)". But it is not reflecting the newly added rows. How to overcome this problem?

 

  • 469350
    Suggested Answer
    Offline posted

    It all depends on what you mean by "grid refresh". The Refresh method on the grid just causes the grid to paint. This will have no effect on the expanded states of the rows.

    If you losing the expanded states on the rows, then you are probably re-setting the grid's data source, or doing something that causes the grid to get a Reset notification from the BindingManager. In such a case, all grid rows are destroyed and a new set or rows is created to show the new data. The grid cannot associate the old rows with the new data.

    The best thing to do in a case like this is to avoid completely re-setting the data source, which is a particularly destructive operation.

    • 255
      posted in reply to Mike Saltzman

      Hi Mike,

      I understood that the grid will be reset and expanded state will not be retained, on getting the reset notification.

      My doubt is how to update the grid with the newly added rows to database and at the same time, expanded state should be retained.

      Is there any way to achieve this? please let me know.

      • 469350
        Offline posted in reply to vidhya

        Hi,

        I'm not sure what you mean by "update the grid with the newly added rows to database".

        What kind of data source are you using for the grid? If your data source gets some new rows added to it, then most data sources will automatically notify bound control that this has happened and you don't have to do anything.