P
Peter
I have a DataGrid control on a form and I used the Auto Format feature to format the grid.
The problem is now if I resize a column in my code I loose some of the formats - some of the grid colors returns to default values. Here is the code that I use to resize a column.
DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.MappingName = "Language";
DataGridTextBoxColumn grdColStyle1 = new DataGridTextBoxColumn();
grdColStyle1.HeaderText = "Language(s) Spoken";
grdColStyle1.MappingName = "Language";
grdColStyle1.Width = 200;
DataGridColumnStyle [] dgcs = {grdColStyle1};
tableStyle.GridColumnStyles.AddRange(dgcs);
this.dgLanguages.TableStyles.Add(tableStyle);
How can I resize columns and retain current formats?
Peter
The problem is now if I resize a column in my code I loose some of the formats - some of the grid colors returns to default values. Here is the code that I use to resize a column.
DataGridTableStyle tableStyle = new DataGridTableStyle();
tableStyle.MappingName = "Language";
DataGridTextBoxColumn grdColStyle1 = new DataGridTextBoxColumn();
grdColStyle1.HeaderText = "Language(s) Spoken";
grdColStyle1.MappingName = "Language";
grdColStyle1.Width = 200;
DataGridColumnStyle [] dgcs = {grdColStyle1};
tableStyle.GridColumnStyles.AddRange(dgcs);
this.dgLanguages.TableStyles.Add(tableStyle);
How can I resize columns and retain current formats?
Peter