ComponentOne FlexGrid for WinForms
Disable Editing for a Specific Column
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.

In the Designer

  1. Select the column in the grid that you would like to edit. This will open the Column Tasks menu for that column.
  2. Uncheck the Allow Editing check box.

Alternatively, the AllowEditing property can be set using the C1FlexGrid Column Editor:

  1. Open the C1FlexGrid Column Editor. For details on how to access the C1FlexGrid Column Editor, see Accessing the C1FlexGrid Column Editor.
  2. Select the column that you would like to edit from the right pane and set the AllowEditing property to False in the left pane.
  3. Click OK to close the editor.

In Code

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;
See Also