Only certain columns in Datagrid are allowed to edit.

C

Chrysan

How do I control only some of the columns in Datagrid are
allowed to be editted?

Should I use DataView or DataTable as the DataSource of my
Datagrid?

Thanks.
 
C

Ciaran O'Donnell

Columns in a datagrid can be marked as readonly so in windows they cant
be edited and on the web they remain html and arent replaced with a
textbox

Ciaran
 
C

Claes Bergefall

The datasource doesn't matter
Check out the DataGridColumnStyle class

/claes
 
D

Dmitriy Lapshin [C# / .NET MVP]

Hello Chrysan,

You should set the ReadOnly property for these columns to true. As far as I
remember, this property is published by the DataGridColumnStyle class that
is the root from which all other data grid column types inherit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top