Datagrid

  • Thread starter Thread starter silesius
  • Start date Start date
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?
 
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);
 
Back
Top