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
320
How to work with auto sort?
posted

Hi all,

I am working with a grid with insert update delete function.
When I insert a row, it will appear at the most bottom of the grid, How can I perform the sorting itself and let the row place the correct place of the grid?

Regards
Andrew

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi Andrew,

    It depends who is doing the sorting. Are the grid rows sorted, or are you sorting the data source? 

    There is no functionality in the grid to insert a row. Most data sources, such as a DataTable, allow you to insert a row, but the BindingManager does not return the proper index of the added row in this case, so the grid doesn't know it wasn't added to the bottom. 

    If you want to simply re-sort the grid, you can use the RefreshSortPosition method on the row or the Refresh method on the grid's SortedColumns collection.

Children