How to set the first 3 columns of dataGridView readOnly to true

146 Views Asked by At

I have a dataGridView in which some data are retrived from database in just first three columns and the forth column is checkBoxColumn which I want to make it checkable ,but when I set the property ReadOnly to my dataGridView it does not allow me to check the checkBoxColumn !!
How can I solve this problem?
With my regards..

1

There are 1 best solutions below

1
On BEST ANSWER

We can add unbound column by clicking on the data grid view tasks.

Then set the below properties.

dataGridView1.AutoGenerateColumns = false;

Then add your column details and assign the data property for each column by clicking on Edit column or add column . also set readonly property for each column to true.

Add Checkbox as last column and set ReadOnly false.