Home Forums WinForms controls Xceed Grid for WinForms Is it possible to provide custom sorting criteria?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #17778 |

    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)

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.