Spread WPF 15
Spread WPF Documentation / Developer's Guide / Managing Data / Sorting Data
In This Topic
    Sorting Data
    In This Topic

    You can sort data in the control and specify a column or row index to sort on as well as the sort criteria.

    Use the SortRange method to sort data.

    Using Code

    The following example sorts a range of cells.

    Copy Code
    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) });
    Copy Code
    For i As Integer = 0 To 9
                GcSpreadSheet1.Sheets(0).SetValue(i, 0, i)
    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)})
    End Sub
    See Also