Spread Windows Forms 12.0 Product Documentation
SortRows(Int32,Boolean,Boolean,IComparer,Boolean,Boolean) Method
Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > SheetView Class > SortRows Method : SortRows(Int32,Boolean,Boolean,IComparer,Boolean,Boolean) Method
Column index whose values are compared during sorting
Whether to sort in ascending order
Whether the sort indicator should be displayed
IComparer object used to compare the values
Whether frozen rows are sorted
Whether trailing frozen rows are sorted
Sorts all the rows on this sheet by the specified column using the specified comparison.
Syntax
'Declaration
 
Public Overloads Function SortRows( _
   ByVal keyColumn As Integer, _
   ByVal ascending As Boolean, _
   ByVal showIndicator As Boolean, _
   ByVal comparer As IComparer, _
   ByVal sortFrozenRows As Boolean, _
   ByVal sortTrailingFrozenRows As Boolean _
) As Boolean
'Usage
 
Dim instance As SheetView
Dim keyColumn As Integer
Dim ascending As Boolean
Dim showIndicator As Boolean
Dim comparer As IComparer
Dim sortFrozenRows As Boolean
Dim sortTrailingFrozenRows As Boolean
Dim value As Boolean
 
value = instance.SortRows(keyColumn, ascending, showIndicator, comparer, sortFrozenRows, sortTrailingFrozenRows)
public bool SortRows( 
   int keyColumn,
   bool ascending,
   bool showIndicator,
   IComparer comparer,
   bool sortFrozenRows,
   bool sortTrailingFrozenRows
)

Parameters

keyColumn
Column index whose values are compared during sorting
ascending
Whether to sort in ascending order
showIndicator
Whether the sort indicator should be displayed
comparer
IComparer object used to compare the values
sortFrozenRows
Whether frozen rows are sorted
sortTrailingFrozenRows
Whether trailing frozen rows are sorted
Example
This example uses the SortRows method.
fpSpread1.ActiveSheet.SetValue(0, 0, "S");
fpSpread1.ActiveSheet.SetValue(0, 1, "E");
fpSpread1.ActiveSheet.SetValue(0, 2, "A");
fpSpread1.ActiveSheet.SetValue(0, 3, "K");
fpSpread1.ActiveSheet.SetValue(1, 0, "W");
fpSpread1.ActiveSheet.SetValue(1, 1, "G");
fpSpread1.ActiveSheet.SetValue(1, 2, "P");
fpSpread1.ActiveSheet.SetValue(1, 3, "V");
fpSpread1.ActiveSheet.SetValue(2, 0, "O");
fpSpread1.ActiveSheet.SetValue(2, 1, "L");
fpSpread1.ActiveSheet.SetValue(2, 2, "Q");
fpSpread1.ActiveSheet.SetValue(2, 3, "H");
fpSpread1.ActiveSheet.SortRows(1, false, true, System.Collections.Comparer.Default, true, true);
fpSpread1.ActiveSheet.SetValue(0, 0, "S")
fpSpread1.ActiveSheet.SetValue(0, 1, "E")
fpSpread1.ActiveSheet.SetValue(0, 2, "A")
fpSpread1.ActiveSheet.SetValue(0, 3, "K")
fpSpread1.ActiveSheet.SetValue(1, 0, "W")
fpSpread1.ActiveSheet.SetValue(1, 1, "G")
fpSpread1.ActiveSheet.SetValue(1, 2, "P")
fpSpread1.ActiveSheet.SetValue(1, 3, "V")
fpSpread1.ActiveSheet.SetValue(2, 0, "O")
fpSpread1.ActiveSheet.SetValue(2, 1, "L")
fpSpread1.ActiveSheet.SetValue(2, 2, "Q")
fpSpread1.ActiveSheet.SetValue(2, 3, "H")
fpSpread1.ActiveSheet.SortRows(1, False, True, System.Collections.Comparer.Default, True, True)
See Also

Reference

SheetView Class
SheetView Members
Overload List