How to set Datagrid Column Properties?

melegant

Well-known member
Joined
Feb 2, 2003
Messages
52
Location
NY
Bascially I have windows form that has a DataGrid on it,

the datasource is determined at runtime using a DataTable.

I fill the grid, now
How can I using code make certain columns read only?

Argh I cant find a dam thing on the .Net.

thanks,
mel
 
Can you use the DataColumns ReadOnly property?

For instance, suppose you have a table in your dataset named Table1 and a column name ID:
C#:
ds.Tables["Table1"].Columns["ID"].ReadOnly = true;

-Nerseus
 
Brilliance!
Thanks Nerseus...I was approaching the datagrid in the wrong way...(the vb.6 infragristics way..)
 
Back
Top