Visual Basic: DataGrid Control

AllowAddNew, AllowDelete, AllowUpdate Properties Example

This example checks the value of a check box. If it is False, the user can't make changes to the grid.

  Private Sub Form_Load ()
   If Check1.Value = 0 Then
      DataGrid1.AllowDelete = False
      DataGrid1.AllowAddNew = False
      DataGrid1.AllowUpdate = False
   End If
End Sub