To undo a sort in C1FlexGrid when the grid is bound to a DataTable, set the DefaultView property to null.
Add the following code to the Button1_Click event:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click CustTable.DefaultView.Sort = "" End Sub |
To write code in C#
C# |
Copy Code
|
---|---|
private void Button1_Click(object sender, System.EventArgs e) { CustTable.DefaultView.Sort = ""; } |
Click the Last Name column to sort on it.
Click the Undo button, and the sort will be undone.