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
90
Manual Sorting
posted

I would like to be able to sort the order of the rows in the XamDataGrid based on the rows source data.

How would I go about doing this with the XamDataGrid, I have been able to do this in the past with both Telerik, and DevExpress grid controls but there does not seem to be a way to do this with the XamDataGrid.

  • 5600
    Offline posted

    Hi,

    If you are using the 12.1 or later version, then you can use the XamDataGrid's FieldLayoutSettings property - SortingEvaluationMode="Manual". Then you can do your custom sorting in the Sorting/Sorted events of the XamDataGrid.

    Another way is to use SortingEvaluationMode="UseCollectionView", then your source should inherit from CollectionView and your custom sorting can be done by using CustomSort comparer. After a custom comparer is applied, then you can sort your data by adding a SortDescription.

    Here is a link where this type of sorting is explained.

    Hope this helps you.

    Anastas

  • 35319
    posted

    Hello Ryan,

     

    Thank you for your post. I can suggest you look into the following link from our online documentation where you can find out how to sort the fields in the XamDataGrid manually :

     

    http://help.infragistics.com/NetAdvantage/WPF/2012.2/CLR4.0/?page=xamDataPresenter_Sorting_and_Grouping_Fields_Programmatically.html

     

    If you need any further assistance on this matter, do not hesitate to ask.