WebCells.Sort

Sort(int, int, int, int, int)

Sorts the datas ascend top to bottom in a range of a WebWorksheet by specified column index.

public void Sort(int startRow, int startColumn, int rows, int columns, int index)
ParameterTypeDescription
startRowInt32The row number of the first cell to sort.
startColumnInt32The column number of the first cell to sort.
rowsInt32Number of rows to be imported.
columnsInt32Number of columns to be imported.
indexInt32The column index that specifis the sort column.

Examples


[C#]

GridWeb1.WebWorksheets[0].Cells.Sort(1,0,25,6,3);

[VB]

GridWeb1.WebWorksheets(0).Cells.Sort(1,0,25,6,3)

See Also


Sort(int, int, int, int, int, SortByOrder, SortOrientation, bool)

Sorts the datas ascend top to bottom in a range of a WebWorksheet by specified column index.

public void Sort(int startRow, int startColumn, int rows, int columns, int index, 
    SortByOrder sortOrder, SortOrientation sortOrientation, bool isCaseSensitive)
ParameterTypeDescription
startRowInt32The row number of the first cell to sort.
startColumnInt32The column number of the first cell to sort.
rowsInt32Number of rows to be imported.
columnsInt32Number of columns to be imported.
indexInt32The column(or row) index that specifis the sort column(or row). If sort orientation is top to bottom, the index represents column index. If sort orientation is left to right, the index represents row index.
orderSortByOrderThe sort order:Ascending or Descending
orientationSortOrientationThe sort orientation: top to bottom or left to right.
isCaseSensitiveBooleanIndicates whether the sort data is case sensitive if the data is string.

Examples


[C#]

GridWeb1.WebWorksheets[0].Cells.Sort(0,1,4,14,3,SortOrder.Ascending,SortOrientation.SortLeftToRight,true)

[VB]

GridWeb1.WebWorksheets(0).Cells.Sort(0,1,4,14,3,SortOrder.Ascending,SortOrientation.SortLeftToRight,True)

See Also


Sort(int, int, int, int, int[])

Sorts the datas ascend top to bottom in a range of a WebWorksheet by some field that are specifed by column indexes array.

public void Sort(int startRow, int startColumn, int rows, int columns, int[] indexes)
ParameterTypeDescription
startRowInt32The row number of the first cell to sort.
startColumnInt32The column number of the first cell to sort.
rowsInt32Number of rows to be imported.
columnsInt32Number of columns to be imported.
indexesInt32[]The column indexes array that specifies the data sorted by.

Examples


[C#]

int[] indexes = new int[3];
indexes[0] = 0;
indexes[1] = 2;
indexes[2] = 3;
GridWeb1.WebWorksheets[0].Cells.Sort(1,0,25,6,indexes);

[VB]

Dim indexes() As Integer =  New Integer(3) {} 
indexes(0) = 0
indexes(1) = 2
indexes(2) = 3
GridWeb1.WebWorksheets(0).Cells.Sort(1,0,25,6,indexes)

See Also


Sort(int, int, int, int, int[], SortByOrder[], SortOrientation, bool)

Sorts the datas ascend in a range of a WebWorksheet by some field that are specifed by indexes array.

public void Sort(int startRow, int startColumn, int rows, int columns, int[] indexes, 
    SortByOrder[] orders, SortOrientation orientation, bool isCaseSensitive)
ParameterTypeDescription
startRowInt32The row number of the first cell to sort.
startColumnInt32The column number of the first cell to sort.
rowsInt32Number of rows to be imported.
columnsInt32Number of columns to be imported.
indexesInt32[]The column(or row) index that specifis the sort column(or row). If sort orientation is top to bottom, the index represents column index. If sort orientation is left to right, the index represents row index.
ordersSortByOrder[]The sort order:Ascending or Descending
orientationSortOrientationThe sort orientation: top to bottom or left to right.
isCaseSensitiveBooleanIndicates whether the sorting is case sensitive.

Remarks

If you use this method to sort a block of data, please be sure that length of the parameter indexes equals length of the parameter orders.

Examples

[C#] int[] indexes = new int[3]; indexes[0] = 0; indexes[1] = 1; indexes[2] = 3; SortOrder[] orders = new SortOrder[3]; orders[0] = SortOrder.Ascending; orders[1] = SortOrder.Descending; orders[2] = SortOrder.Descending; GridWeb1.WebWorksheets[0].Cells.Sort(0,1,4,14,indexes,orders,SortOrientation.SortLeftToRight,false); [VB] Dim indexes() As Integer = New Integer(3) {} indexes(0) = 0 indexes(1) = 1 indexes(2) = 3 Dim orders() As SortOrder = New SortOrder(3) {} orders(0) = SortOrder.Ascending orders(1) = SortOrder.Descending orders(2) = SortOrder.Descending GridWeb1.WebWorksheets(0).Cells.Sort(0,1,4,14,indexes,orders,SortOrientation.SortLeftToRight,False)

See Also