Start New Discussion within our Software Development Community

I have a Datagridview in C# windows Application
In it i have one ComboBoxColumn out of 12 datagridview columns

Now I want to disable/enable cells of particular row on ComboBoxColumns selected index chaged event according to Condition.

Not Gridview's whole column should enable/disable, I want Cells of particular selected Row of ComboxBox

How can i do this in C# windows application

Since you didnt say much about your issue (I would need some better explanation oif the problem), I will show you how to disable/enable cells.

dgv[columnIndex, rowIndex].ReadOnly = true; //this will disable specific cell!
//set to false, if you want it to be enable again!
//beside, if you want it to make look ore real in gray color, you can change the backColor:
dgv[colummIndex, rowIndex].DefaultCellStyle.BackColor = Color.LightGray;
//and then set it back to white when enabling.

columnIndex is an integer for the column
rowIndex is an integer for the row
like:
dgv[1,3].XXXX:
1. is 2nd column
3. is 4th row

Hopw it helps a bit, if not, I will need some better explanation,
Mitja

This question has already been answered. Start a new discussion instead.