I want to enable only two columns in the DataGridview to be able to edit. The others should not be allowed to edit. Further I am not directly linking to datasource; I will b
foreach (DataGridViewColumn dc in dataGridViewX1.Columns) { if (dc.Index.Equals(0) || dc.Index.Equals(1)) { dc.ReadOnly = false; } else { dc.ReadOnly = true; } }