FlexGrid for WPF
ソート
基本操作 > ソート

FlexGrid control by default lets you to sort by any column. The user simply has to click on the header of a column to toggle between the sorting states, ascending and descending.

If a user clicks the column header, it sorts by that column. In this case, the column header shows an upward pointing arrow indicating ascending order. Likewise, if a user clicks the column header once more, that is, the second time, the column sorts in descending order, with the arrow pointing downwards.

The snapshot below depicts sorting feature by the "Description" and "UnitPrice" columns:

A snapshot of flexgrid application with data, showing two highlighted columns in ascending and descending orders.

The user can also choose to set the AllowSorting property in C1FlexGrid class or AllowSorting property in the Column class to 'false' to prevent sorting in the entire FlexGrid control or a desired column within the control.