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
1140
Error in updaing the DataSet
posted

Hi,

I am doing Drag-Drop operations on the Grid successfully. I am using them to re-order the rows on the grid.  But Once I assign the datasource of the grid back to a dataset, the order of the rows goes back to normal in the way which I got.

Is there something I need to do to get back the order in the same way ?

 

Let me know

Nagarjun.

  • 469350
    Suggested Answer
    Offline posted

    Hi Nagarjun,

    The grid sorting has no effect on the data source, the sorting is all done locally within the grid. If you re-assign the data source to the grid or assign a new datasource, then all of the existing rows in the grid are destroyed and a whole new set of rows created to show the new data. The grid has no way to connect any old rows with the new rows. So there's no way it can possibly maintain the sort order.

    The best thing to do is to avoid re-setting the data source, if you can.

    If that's not an option, then maybe you could store a row position of some kind in your data source and then sort the data by that field when you retrieve it.