I want to have a table displayed on a DataGridView with multiple columns, all of them on readonly but one. This one column needs to have the capacity of being filled by the user, but I want to make the cells that already have content on them ReadOnly, not all the column so the user will still have the capacity of fill the remaining cells on the column (with the exception of the ones that already have been filled)
Is there a way to achieve this?
You can set
CellEndEditevent simply like this:VB.NET:
And if you have data in the
DataGridViewat the beginning, you can set the access after you load the data like this:VB.NET:
...providing this function in your class:
VB.NET:
Tested, all works as a charm.
Obviously you can play with the code, i.e. excluding the last column by modifying the range of column loop:
VB.NET (same):
Sorry, missed the c# tag when replied first.