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
1145
Preserve selected row after data refresh?
posted

Was not sure how to phrase my search for help on this, so I have failed miserably...  I have a grid with 3 bands of related data (bucketed) and for example, a user drills-in and selects a record in the third band.  Other processing takes place that changes the data in the database.  The user is prompted if they want the data in the grid refreshed to see the impact of the action. Once refreshed, the user has to remember which record they had previously selected and they begin to hunt (drill back into the data) to get back to where they left off prior to the refresh.

Do to the complexity of the data, the calc engine, etc., it is not an option to update the data bound to the grid - the data must be re-fetched from the database.

In short, how I do programmatically get them back to the record they selected? 

Many thanks!

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    This is a pretty common question, actually. The answer is, there is no way the grid can do this.

    When you re-bind the grid, you are giving it a whole new set of row objects. So there's no way for the grid to associate the old rows with the new ones.

    If your data includes a Primary Key, then you could store the current state of the grid, then try to go find the same keys in the new data. Of course, there is always the possibility that the key no longer exists if that row was deleted, so I don't know what behavior you would want in that case.

Children