Making Query Columns Read-Only

snypa

Member
Joined
Jan 23, 2009
Messages
5
Programming Experience
Beginner
Hi

I was just wondering if it is possible to make some columns returned by a query read-only, I know I can make the whole result read-only but I would like it on only some columns

Thank you
 
Last edited:
You can set the ReadOnly property of a DataColumn of a DataTable, but it won't help you getting an exception if you're using it in for example an editable grid. Instead set the grid column or other edit control readonly.
 
A DataColumn in a DataTable can be read only -> set this in the properties for that column in the dataset designer (or in code if you didnt use the designer)
A DataGridViewXXXColumn can also be read only -> set this in the properties for that column in the .Columns property of the DataGridView in the form designer
 
Back
Top