Add(Index: Integer): ITabCustomSortItem;
Add(Index: Integer): Prognoz.Platform.Interop.Tab.ITabCustomSortItem;
Index is the parameter determines relative index of range row or range column selected to set up sorting.
The Add method adds a new sorting area in a data table.
To execute the example a form with a button on it named Button1, the TabSheetBox component and the UiTabSheet component with the name UiTabSheet1 which is used as a data source for the TabSheetBox component are required.
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.
To execute the example a form with a button on it named Button1, the TabSheetBox component and the UiTabSheet component with the name UiTabSheet1 which is used as a data source for the TabSheetBox component are required.
Public Partial Class OBJ33041Form : Prognoz.Platform.Forms.Net.ForeNetForm
CustomSort: ITabCustomSort;
tab: ITabSheet;
Public Constructor OBJ33041Form();
Begin
InitializeComponent();
End Constructor;
Private Sub button1_Click( sender : System.Object; e : System.EventArgs );
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.TcsdAscending;
tab.CustomSort.Item[0].Type := TabCustomSortType.TcsText;
CustomSort.Sort();
End Sub;
End Class;
On clicking the button in a column with the A index, the ascending sorting is set.
See also: