# Disable Editing

FlexGrid for WinForms provides support to disable editing at grid, row and column level. You can also disable editing of a cell. Know more about disabling here.

## Content

**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 <span data-popup-content="This property is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET\u003c/a\u003e." data-popup-title="AllowEditing" data-popup-theme="ui-tooltip-green qtip-green">AllowEditing</span> property of the <span data-popup-content="This class is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET\u003c/a\u003e." data-popup-title="C1FlexGrid" data-popup-theme="ui-tooltip-green qtip-green">C1FlexGrid</span> class to **false** as shown in the code below.

```csharp
// Disable grid editing 
 c1FlexGrid1.AllowEditing = false;
```

```vbnet
' 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 <span data-popup-content="This class is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET\u003c/a\u003e." data-popup-title="Row" data-popup-theme="ui-tooltip-green qtip-green">Row</span> or <span data-popup-content="This class is available in both \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET Framework\u003c/a\u003e and \u003ca href=\u0022/componentone/docs/win/online-flexgrid/\u0022\u003e.NET\u003c/a\u003e." data-popup-title="Column" data-popup-theme="ui-tooltip-green qtip-green">Column</span> object to **false** as shown in the code below.

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

```vbnet
' 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**.

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

```vbnet
' Disable cell editing 
Private Sub C1FlexGrid1_BeforeEdit(ByVal sender As Object, ByVal e As RowColEventArgs)
    If e.Col = 4 AndAlso e.Row = 2 Then
        e.Cancel = True
    End If
End Sub     
```