Edit / Disable Editing
Disable Editing

FlexGrid, by default, allows end-user to edit the cell values at runtime. However, with FlexGrid, you can easily manage how much control you want to give to the end-users using various properties provided by the FlexGrid.

Disable Grid Editing

To disable editing of the whole WinForms FlexGrid, you need to set AllowEditing property of the C1FlexGrid class to false as shown in the code below.

 // Disable grid editing 
 c1FlexGrid1.AllowEditing = false;

Disable Row or Column Editing

To disable the editing of a particular row or column of the WinForms FlexGrid, you can set the AllowEditing property of Row or Column object to false as shown in the code below.

// Disable editing of third row
c1FlexGrid1.Rows[3].AllowEditing = false;
                                        
// Disable editing of third column
c1FlexGrid1.Cols[3].AllowEditing = false;

Disable Cell Editing

To disable editing of a particular cell, you can use the BeforeEdit event and set the Cancel parameter for that particular cell to true.

// Disable cell editing 
private void C1FlexGrid1_BeforeEdit(object sender, RowColEventArgs e)
   {
     if ((e.Col == 4) && (e.Row == 2))
      {
          e.Cancel = true;
      }
   }