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
585
Retaining Column Order and size after a data refresh
posted

 

I have an ultragrid in a winform application.  The columns are resizable and movable.   The data refreshes on a frequent basis (i.e. I go get more data in a dataset and bind it to the ultragrid)

This is probably a dumb question, but...

If the user moves and resizes a few columns, how do I ensure that when the data refreshes the columns retain their size and position instead of going back the way they were initially?

 Note, that I don't need this to persist outside of the current session.  When the application restarts, the user's modification to the columns can be lost.

 Thanks so much,

 Steve

 

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Steve,

    This question comes up quite a lot, so you might want to search the forums for te word Refresh. 

    It really comes down to what you mean by "refresh". If your data source is sending Reset notifications, then the grid has to throw away the whole layout and start over, building a new layout from the new data structure which may or may not match the old one. So the best thing to do is try to avoid Reset notificiations from your data source. 

    If that's not possible, then the only thing you can do is save the grid.DisplayLayout before the reset and then re-load it afterward.

Reply Children