I have a datagridview (dgvScheduleInfo). In its properties I have the "ReadOnly" set to true. I have 6 columns (0-5). The last column ("Notes") I want to make editable if someone clicks on a "Edit Notes" button. Sounds simple enough.
I've used the following code to no avail:
dgvScheduleInfo.Columns("Notes").ReadOnly = False
The code above errors out with a "Object reference not set to an instance of an object."
I've tried hard-coding a value for testing purposes:
dgvScheduleInfo.Rows(3).Cells(5).ReadOnly = False
And this is ultimately what I want to work:
dgvScheduleInfo.Rows(dgvScheduleInfo.CurrentRow.Index).Cells(5).ReadOnly = False
When I step through the code, I only get an error on the one I specified. Other then that though the code steps through fine but does not set the column I'm requesting to be editable.
Now yet another curveball...
If I use:
dgvScheduleInfo.ReadOnly = False
It works fine but turns ALL the cells on which I don't want. I only want the "Notes" (or column 5) to be editable.
I've changed the "EditMode" to a couple of different things as well. Nothing.
Hopefully it's something very easy I'm missing.

New Topic/Question
Reply




MultiQuote







|