Visual Basic: DataGrid Control
Returns or sets a value indicating whether the user can delete records from the Recordset object underlying a DataGrid control.
object.AllowDelete [= value]
The AllowDelete property syntax has these parts:
|object||An object expression that evaluates to an object in the Applies To list.|
|value||A Boolean expression that determines whether a user can delete records, as described in Settings.|
The settings for value are:
|True||Users can delete records from the Recordset object underlying the DataGrid control.|
|False||Users can't delete records from the Recordset underlying the DataGrid control.|
Use the AllowDelete property to prevent the user from deleting records from the Recordset through interaction with the DataGrid control.
The underlying Recordset may not enable deletions even if the AllowDelete property is True for the DataGrid control. In this case, an error occurs when the user tries to delete a record.
Note After deleting a record from a DataGrid control, you should use the Refresh method on it to force the DataGrid to update. Otherwise, although a record has been deleted from the underlying recordset, the record will still show in the DataGrid.