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
180
Row position in the grid vs the Position in the Binding Source
posted

Hi,

I have a ultragrid binded to .Net binding source which is binded to a List of a custom class. If dont have sorting set for any column on the grid. The sequence of objects in rows matchs the sequence of objects displayed in the grid. or positiong in binding source is same as display index in grid.

The problem occurs if i sort the grid column. now the row number dont match the position of the row in the binding source or the list. The gid displays the data in the newly sorted format but done not move the data in the undelying binding source to match the UI dispaly index.

 Is there is property or a specific binding source that i can use to get these two in sync sutomatically.

Saurabh

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi Saurabh,

    No, the grid can't sort the actual data in your data source, because not all data sources support sorting and there are no sort methods on IBindingList.

    You should not rely on row numbers, anyway, because these can change for a wide variety of reasons like sorting, filtering, adding or deleting rows, fixing rows, etc.

    If you want to get the underlying data row from a grid row, you can use the ListObject property on the row.

Reply Children