How to: Make Columns Read-Only in the Windows Forms DataGridView Control

 

Not all data is meant for editing. In the DataGridView control, the column ReadOnly property value determines whether users can edit cells in that column. For information about how to make the control entirely read-only, see How to: Prevent Row Addition and Deletion in the Windows Forms DataGridView Control.

There is support for this task in Visual Studio. Also see How to: Make Columns Read-Only in the Windows Forms DataGridView Control Using the Designer.

To make a column read-only programmatically

Compiling the Code

This example requires:

Show: