Library Vcl NextSuite 6 NextGrid6 Articles Sorting Events

Sorting Events

Sorting process is started after user click on header of a column, or one of the following properties are changed:

In single column sort mode, only one column can have Sorted property set to True.

There is a handy property SortedColumn which can be used to determine sorted column. If there are no sorted column, this property return nil.

Example

pas
NextGrid61.Columns[5].Sorted := True;
NextGrid61.Columns[3].SortKind := skDescending; // add NxTypes6 in uses
PersonColumn.SortType := stCaseInsensitive;
if CustomersGrid.Column.SortedColumn <> nil then CustomersGrid.Columns.SortedColumn.SortKind := skAscending;

If SortType is set to stCustom. OnCellCompare event will occur during sorting routine. This event is handy for Custom Sorting.

There are several events used in sorting process. They are occurring in next order:

Diagram

Sign in