We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Disable Automatic Sorting when Datachanges

In GridGroupingControl 2.0.5.1 If a user sorts a column, can I disable the behavior that keeps the grid sorted when changes are made? i.e., if I sort by column X, and then begin changing the values in column X, the grid keeps sorting. I want to sort Once and force the user to click the column again to sort again, instead of keeping it sorted with each change. Any ideas?

1 Reply

AD Administrator Syncfusion Team September 28, 2005 11:19 PM UTC

Hi, The grid structures require to have the records always be sorted according to the sort order. Otherwise things will get out of sync. The only way you can get this working is if you do not let the grid engine do the sorting. What you could do is have your own implementation of an IBindingList. This IBindingList should be filled with the data that you want to display in the grid. You could then listen to the click event on the column header and then do a custom sorting yourself. When you handle the sort you could then manually sort your list and after that raise a ListChangedType.Reset event so that the grid knows the records were changed. You should not modify the grid SortColumns collection. If you do it this way the grid will simply display the records in the order as they are in your custom list and when you change contents of a record or add a record it will not need to sorted. It will hoevever not work if you also require grouping columns ... Stefan >In GridGroupingControl 2.0.5.1 > >If a user sorts a column, can I disable the behavior that keeps the grid sorted when changes are made? > >i.e., if I sort by column X, and then begin changing the values in column X, the grid keeps sorting. I want to sort Once and force the user to click the column again to sort again, instead of keeping it sorted with each change. > >Any ideas? >

Loader.
Live Chat Icon For mobile
Up arrow icon