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

Custom Sorting

Hello,

Could you please send me a sample how to apply a custom sorting on a column in sfDataGrid. 

I am trying to apply the sorting on a column whose type is string using---
<syncfusion:SfDataGrid.SortColumnDescriptions>
<syncfusion:SortColumnDescription ColumnName="Country" SortDirection="Descending" />
</syncfusion:SfDataGrid.SortColumnDescriptions>
But it does not work.

I wrote a custom IComparer for that column (Country) and try to add that to the SortComparers collection of sfDataGrid but sfDataGrid does not seem to support SortComparers.

Finally I have downloaded a sample from your site on how to use custom sorting. It works with .Net4.5 but does not work with .Net4.5.1?

 I am using Net4.5.1

Appreciate your help.

Regards,
Soumyajit Roy


1 Reply

JG Jai Ganesh S Syncfusion Team December 23, 2015 07:08 AM UTC

Hi Soumyajit,


Thank you for contacting Syncfusion Support.


We have analyzed your query. You can apply the custom sorting for a column in SfDataGrid by using the Custom Comparer. We already have a UG document that explains “CustomSorting for Columns”


UG Link:

http://help.syncfusion.com/wpf/sfdatagrid/sorting#custom-sorting


Sample: http://www.syncfusion.com/downloads/support/directtrac/148754/ze/CustomSorting1975669452


In the above sample, we have used the .Net Framework version 4.5.1 and the custom sorting works fine from our side. If the issue still persists, please share more information about the issue or the sample you have tried. This would be more helpful for us to analyze further.


Regards,

Jai Ganesh S


Loader.
Up arrow icon