FlexGrid for WinForms Task-Based Help > Restricting Sorting for a Specific Column |
To restrict sorting for a specific column, set the AllowSorting property to False either in the designer or in code.
Alternatively, the AllowSorting property can be set using the C1FlexGrid Column Editor:
Add the following code to the Form_Load event to restrict sorting the AtomicNumber column:
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Me.C1FlexGrid1.Cols("AtomicNumber").AllowSorting = False ' Is the same as: Me.C1FlexGrid1.Cols(1).AllowEditing = False |
To write code in C#
C# |
Copy Code
|
---|---|
this.c1FlexGrid1.Cols["AtomicNumber"].AllowSorting = false; // Is the same as: this.c1FlexGrid1.Cols[1].AllowEditing = false; |