ITabCustomSort.Add

Syntax

Add(Index: Integer): ITabCustomSortItem;

Parameters

Index is the parameter determines relative index of range row or range column selected to set up sorting.

Description

The Add method adds a new sorting area in a data table.

Example

Executing the example requires a form with the Button1 button located on it, the TabSheetBox component and the UiTabSheet component named UiTabSheet1, that is used as a data source for the TabSheetBox component.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        CustomSort: ITabCustomSort;
    Begin
        CustomSort := tab.CustomSort;
        CustomSort.Range := tab.Table;
        CustomSort.Add(Tab.ColumnIndex("A"));
        text := CustomSort.Count.ToString;
        tab.CustomSort.CaseSensitive := True;
        CustomSort.Item(0).Direction := TabCustomSortDirection.Ascending;
        tab.CustomSort.Item(0).Type := TabCustomSortType.Text;
        CustomSort.Sort;
        tab.CustomSort.IsColumnSort := False;
    End Sub Button1OnClick;

On clicking the button in a column with the A index, ascending sorting is set.

See also:

ITabCustomSort