Syncfusion.SfDataGrid.XForms
Example 

SortComparers Property (SfDataGrid)

Gets the Syncfusion.Data.SortComparers of SfDataGrid, for applying sorting to the columns based on the custom logic. SfDataGrid allows you to sort columns based on custom logic when the standard sorting techniques do not meet the requirements. For each column, you can apply different sorting criteria by adding Syncfusion.Data.SortComparer objects to SortComparers collection.
Syntax
public SortComparers SortComparers {get;}

Property Value

The Syncfusion.Data.SortComparers of SfDataGrid.
Remarks
SfDataGrid allows you to sort columns based on custom logic when the standard sorting techniques do not meet the requirements. For each column, you can apply different sorting criteria by adding Syncfusion.Data.SortComparer objects to SortComparers collection. The Syncfusion.Data.SortComparer has the two properties : Syncfusion.Data.SortComparer.PropertyName which refers to MappingName of the column to apply sorting. and Syncfusion.Data.SortComparer.Comparer which refers to the custom sort comparer that implements the System.Collections.IComparer and Syncfusion.Data.ISortDirection interfaces.
Example
dataGrid.SortComparers.Add (new SortComparer () 
    {
    PropertyName = "FirstName",
    Comparer = new CustomComparer()
    });
dataGrid.SortColumnDescriptions.Add (new SortColumnDescription()
    {
    ColumnName = "FirstName",
    SortDirection = ListSortDirection.Descending
    });
    
//CustomComparer.cs
public class CustomComparer : IComparer<Object>, ISortDirection
{
            
}
AssemblyVersion

Syncfusion.SfDataGrid.XForms: 17.2451.0.34

See Also