BCGControlBar Library for .NET
SortData Method




Starting column index in range.
Sort order (ascending - true, descending - false).
End column index in range.
Start row index in range.
End row index in range.
Sorts data in the specified range.
Syntax
'Declaration
 
Public Sub SortData( _
   ByVal columnIndex As Integer, _
   ByVal ascending As Boolean, _
   ByVal endColumnRangeIndex As Integer, _
   ByVal startIndex As Integer, _
   ByVal endIndex As Integer _
) 
'Usage
 
Dim instance As GridData
Dim columnIndex As Integer
Dim ascending As Boolean
Dim endColumnRangeIndex As Integer
Dim startIndex As Integer
Dim endIndex As Integer
 
instance.SortData(columnIndex, ascending, endColumnRangeIndex, startIndex, endIndex)
public void SortData( 
   int columnIndex,
   bool ascending,
   int endColumnRangeIndex,
   int startIndex,
   int endIndex
)
public: void SortData( 
   int columnIndex,
   bool ascending,
   int endColumnRangeIndex,
   int startIndex,
   int endIndex
) 
public:
void SortData( 
   int columnIndex,
   bool ascending,
   int endColumnRangeIndex,
   int startIndex,
   int endIndex
) 

Parameters

columnIndex
Starting column index in range.
ascending
Sort order (ascending - true, descending - false).
endColumnRangeIndex
End column index in range.
startIndex
Start row index in range.
endIndex
End row index in range.
Remarks

This methods sorts data in the specified range of columns and rows.
It does not change order of rows in RowCollection and does not create any additional sort index. It swaps data according to the sort order, e.g it modifies the GridDataRow.ItemCollection collections.

This is usable for Excel-like grids when you do not move columns and rows around.
The Grid control automatically calls SortData, when GridControl.OperationMode is set to ContentOperationMode.RepositionData.

If endColumnRangeIndex is -1 then the sort range covers one column specified by columnIndex.
You can set startIndex and endIndex to -1 to sort all rows in the grid. 

Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

GridData Class
GridData Members

Send Feedback