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
4165
How does the grid decided how to sort items when no sort applied?
posted

Hi,

I have an interesting issue. We have a grid with items. When a user adds a new item we refresh the datasource (SQL data table connected to a data adapter) and 99% of the time the new item appears at the bottom of the grid.

Sometimes though it appears as the 2nd row. How does the grid determine the sort if no sort is applied?


Thanks,

M.

Parents
  • 12480
    Offline posted

    Hello,

    UltraGrid shouldn't be doing anything to sort items when no sort is applied -- it should display them in the order that they exist in the data source.

    Is it possible that items are getting added to the data source out of order? If this is happening, then the grid would be expected to reorder items after rebinding.

    If you need to have the items sorted in a specific way, my recommendation is to apply a sort. You can sort based on something like a primary key or an ID field that maintains the order rows were added. You can sort on such a field even if it was hidden from end users.

    Finally, if the grid is definitely showing items in a different order than the data source, then this is unexpected behavior. In order to investigate in this case, we will need a reproduction sample.

    Please let me know how you choose to proceed.

Reply Children