Datagrid

S

silesius

I hava a datagrid bound to a dataset and would like to control which columns
in the datagrid can be edited.
What's the easiest way?
 
G

Guest

I typically use a DataGridTableStyle in order to format DG display, handle
null values, etc. You can set ReadOnly = true ,as illustrated below, to
disable editing at the column level:

// Add au_lname style
DataGridColumnStyle dgcLastName = new DataGridTextBoxColumn();
dgcLastName.MappingName = "au_lname";
dgcLastName.HeaderText = "LastName";
dgcLastName.ReadOnly = true;
ts1.GridColumnStyles.Add(dgcLastName);
 

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