Sort([Column: ITreeListColumn = Null;][Direction: SortDirection = 0]);
Column. Column, by which the sorting should be performed. If the parameter is not defined, the sorting is performed by the column specified in the SortColumn property.
Direction. The direction of sorting that should be set in the column. If the parameter is not assigned, the ascending sorting should be set .
The Sort method sorts elements of the specified column in the specified direction.
The Sort method is relevant, if the Sorted property is set to True, and the SortType property is set to a value other than None.
Executing the example requires a form, a button named Button1 positioned on it and the TreeList component named TreeList1.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
TreeList1.SortType := ControlSortType.Text;
TreeList1.Sorted := True;
TreeList1.Sort(TreeList1.Columns.Item(0), SortDirection.Descending);
End Sub Button1OnClick;
Clicking the button executes descending sorting. The sorting is performed by the first column
See also: