Home Forums WPF controls Xceed DataGrid for WPF Cancel sorting when SortCollectionChanged

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • User (Old forums)
    Post count: 23064
    #26196 |

    My questions is Can I cancel sorting operation somewhere before Grid is sorted??
    My datagrid is filled with just part of my data (pagination). I do need the sorting functionality in the grid, but the problem is that using the default sorting, the datagrid only sorts part of the data. I need to execute custom sort. I was using all the information, column names and type of sort in the SortCollectionChanged event and execute my custom sort but I get an error of not “finished operation” because later I try to redefine a new ItemSource for the Grid. The problem is that the Sorting operation never ends. That’s why I was wondering if there is a way to cancel the sort operation on the SortCollectionChanged event??

    Imported from legacy forums. Posted by Darwin (had 2002 views)

    Xceed Support
    Post count: 5658

    There is no direct hook in the DataGridControl to “cancel” the built-in sorting.

    However, you could override the default ColumnManagerCell behavior by building your own ColumnManagerCell/Row derived classes.

    Sorting logic is done in the OnMouseLeftButtonUp() method, so you could avoid calling base for your particular scenario and invoke the appropriate sorting algorithm.

    Note: You should make sure the Data Source “resets” after your sorting is complete for the DataGridControl to refresh.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 3079 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.