I have a datagridview in windows form. Datagridview looks like below:
In this, have one Checkbox column, two textbox column.
My requirement is need to hide checkbox from the cell for the country has Germany as like below.
For this, I tried by two ways:
By setting visible property as false.
datagridview.Rows[rowIndex].Cells[columnIndex].visible = false;
When using visible property, it showing error like cannot assigned to readonly.
Trying by converting the type of datagridview cell from checkbox to textbox for the particular cell.
DataGridViewTextBoxCell textBoxCell = new DataGridViewTextBoxCell();
datagridview.Rows[rowIndex].Cells[columnIndex] = textBoxCell;
For this, I am getting error like "Formatted value of the cell has a wrong type".
Is anyone have idea for this?