Home Forums WPF controls Xceed DataGrid for WPF custom sort?

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

    Hi, I’m a bit confused abut the current custom sorting capabilities of the datagrid; in the documentation I find a sample for grouping according to a custom sortcomparer, but nothing about custom sort proper. So:

    – in the case of a grid having a specific (hidden) column corresponding to a field with calculated values for sorting, is there a way of telling another column to filter according to the hidden column? e.g. (that’s a pointless sample, but just for clarity) let’s say I have a field with strings like “one”, “two”, “three” (column A, visible) and another field with their numeric values 1,2,3 (column B, hidden): is there a way of telling the grid that whenever the user wants to sort by A the sort values should be retrieved from B?

    – in the case of sort values being calculated during sort, is there a way of providing a custom sort function like the IComparer implementors used for custom grouping? And if not, what are your plans and schedules about this feature now that 2.0 is forthcoming?


    Imported from legacy forums. Posted by Mathetes (had 2976 views)

    Xceed Support
    Post count: 5658

    Hi Mathetes,

    You can implementing a sorting of a field using values of another by implementing a custom comparer, a DataGridItemProperty whose valuePath is the entire business object and a CellContentTemplate that will display the desired field.

    Find attached a sample that implements such feature.


    Imported from legacy forums. Posted by Mohamed [Xceed] (had 781 views)

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