Spread WPF Documentation
SortInfo Constructor(Int32,Boolean)
Example 


GrapeCity.Windows.SpreadSheet.Data Namespace > SortInfo Class > SortInfo Constructor : SortInfo Constructor(Int32,Boolean)
The index of the column or row on which to sort.
If set to true, sort order is ascending.
Creates a SortInfo object with the specified order that uses the system default comparer for the comparison.
Syntax
'Declaration
 
Public Function New( _
   ByVal index As System.Integer, _
   ByVal ascending As System.Boolean _
)
'Usage
 
Dim index As System.Integer
Dim ascending As System.Boolean
 
Dim instance As New SortInfo(index, ascending)
public SortInfo( 
   System.int index,
   System.bool ascending
)

Parameters

index
The index of the column or row on which to sort.
ascending
If set to true, sort order is ascending.
Example
This example sorts a range.
for (int i = 0; i < 10; i++)
            {
                gcSpreadSheet1.Sheets[0].SetValue(i, 0, i);
            }

 private void Button_Click(object sender, RoutedEventArgs e)
        {
            gcSpreadSheet1.Sheets[0].SortRange(0, 0, 10, 1, true, new SortInfo[] { new SortInfo(0, false) });
            gcSpreadSheet1.Invalidate();
        }
For i As Integer = 0 To 9
            GcSpreadSheet1.Sheets(0).SetValue(i, 0, i)
        Next

Private Sub Button_Click(sender As System.Object, e As System.Windows.RoutedEventArgs)
        GcSpreadSheet1.Sheets(0).SortRange(0, 0, 10, 1, True, New SortInfo() {New SortInfo(0, False)})
        GcSpreadSheet1.Invalidate()
    End Sub
See Also

Reference

SortInfo Class
SortInfo Members
Overload List