ITabRange.SortRows

Fore Syntax

SortRows(ColumnIndex: Integer; Ascending: Boolean);

Fore.NET Syntax

SortRows(ColumnIndex: Integer; Ascending: Boolean);

Parameters

ColumnIndex. Index of the column which values determine how the rows are to be sorted.

Ascending. The parameter that determines sorting direction. If the parameter is set to True, the values are sorted in ascending order.

Description

The SortRows method sorts a row range based on the values from the column with the ColumnIndex index.

Comments

After executing the method, the rows are rearranged in such a way that the values in the ColumnIndex column are sorted depending on the sorting order.

Example

To execute the example, a form, a button on this form named Button1, the TabSheetBox component named TabSheetBox1 and a data source for this component are required.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        TabSheetBox1: TabSheetBox;
        Range: ITabRange;
    Begin
        Range := TabSheetBox1.Source.GetTabSheet.Rows(09);
        Range.SortRows(0True);
    End Sub Button1OnClick;

After executing the example clicking the button sorts the first ten rows of the table by values of the first column.

Fore.NET Example

To execute the example, a form, a button on this form named Button1, the TabSheetBoxNet component named TabSheetBoxNet1 and a data source for TabSheetBoxNet are required.

    Private Sub button1_Click(sender: System.Object; e: System.EventArgs);
    Var
        Range: ITabRange;
    Begin
        Range := TabSheetBoxNet1.Source.GetTabSheet().Rows[09];
        Range.SortRows(0True);
    End Sub;

After executing the example clicking the button sorts the first ten rows of the table by values of the first column.

See also:

ITabRange