S silesius Dec 14, 2004 #1 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 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 Dec 15, 2004 #2 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);
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);