blah blah blah is here! blah blah » Close

up0down
link

salam guyz!

i made my datagridview readonly through its readonly property now i want to make one of those columns editable from the datagridview.if any body can help me with some details it will be my pleasure...

thanks
khoda hafiz

last answered one year ago

1 answers

up0down
link

Rather than set the whole DGV to be readonly, you'll need to set each individual column to be readonly except the one which you want to be editable.

Suppose, for example, that you have a DGV called dataGridView1 and you want all columns to be readonly except the one with a header containing "Address".

The code to do that would be:

foreach (DataGridViewColumn column in dataGridView1.Columns)
{
if (column.HeaderText != "Address") column.ReadOnly = true;
}

Feedback