Make one cell editable in datagridview c #
4 answers
You can change every cell in a read-only column if the cell value is not null or String.Empty. This will allow the user to edit those cells that are blank and protect your data.
Just loop through the DataGridViewRow: -
Foreach(DataGridViewRow row in DataGridView1.Rows)
{
If(!row.Cells[2].Value.Equals(null) || !row.Cells[2].Value.Equals(String.Empty))
{
row.Cells[2].ReadOnly = true;
}
}
0
source to share