Any class that implements the IComparer interface can be used by Xceed Grid for .NET to custom sort columns. To assign a data comparer to a column, the column’s DataComparer property must be set. This data comparer will then be used when sorting the column to which it was assigned. For example:
gridControl1.Columns[ “ShipAddress” ].DataComparer = new AddressComparer();
An example of a class that implements the IComparer interface is available below (see attachments).
The AddressComparer class will first sort addresses which begin with numeric values by street name and then civic number. The remainder of the addresses in the regular alphabetical fashion.
Imported from legacy forums. Posted by Xceed admin (had 1948 views)