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
1325
Revert back the grid to how it was before sorting if we sorted it?
posted

Hi,

I have a problem. The thing is that suppose if we sort a column and if I want to display the data in grid as it was there before the sorting (of column/s) in a button's client side click, then how can it be achieved? Is it possible? If so how? Any help will be highly appreciated.

I just want to revert the grid back to its state without sorting of data.

Thanks & regards,

Assyst

  • 49378
    Suggested Answer
    posted

    Hi Assyst,

    It has been a while since your post, however in case you still need assistance I would be glad to help.

    I would suggest that you use the ColumnSorting client-side event of the grid to implement your logic for removing the sorting. Here is some sample code for clearing the sorting when the column sorting is to be descending:


    function WebDataGrid1_Sorting_ColumnSorting(sender, eventArgs) {
       
    if (eventArgs.get_sortDirection() == 2) {
           sender.get_behaviors().get_sorting().clear();
        }
    }

    Please contact me if you have any questions.

    Best Regards,

    Petar Ivanov
    Developer Support Engineer
    Infragistics, Inc.
    http://ko.infragistics.com/support