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