System.Windows.Forms.DataGrid.ReadOnly Property

Gets or sets a value indicating whether the grid is in read-only mode.

Syntax

[System.ComponentModel.DefaultValue(false)]
public bool ReadOnly { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

In read-only mode, the grid can be scrolled, nodes can be expanded or collapsed, and so on. However, no additions, edits, or deletes can take place.

The System.Windows.Forms.DataGridColumnStyle also has a DataGridColumnStyle.ReadOnly property that can be set to true to prevent data from being edited, on a column-by-column basis.

The DataGrid.ReadOnly can be set to true if you want to prohibit the user from editing the data directly in the System.Windows.Forms.DataGrid. For example, you might want to let users to see all columns in a table, but allow them to edit specific fields only through System.Windows.Forms.TextBox controls on a different form.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0