Here is the code from a button_click event:
//Populate the struct array
data[0].SetData("Iin", "Input Current");
data[1].SetData("Vo_HL NL_pct", "High line full load output voltage");
//Create new table style and mapping name
DataGridTableSt yle ts = new DataGridTableSt yle();
ts.MappingName = "Table";
//Create STEP column styles, mapping name and header text
//Bug: header text does not show...Width not changed
DataGridTextBox Column cs1 = new DataGridTextBox Column();
cs1.MappingName ="STEP";
cs1.HeaderText= "STEPXxxx";
cs1.Alignment=H orizontalAlignm ent.Center;
cs1.Width=200;
ts.GridColumnSt yles.Add(cs1);
//Create STEP column styles, mapping name and header text
//Bug: Width not changed
DataGridTextBox Column cs2 = new DataGridTextBox Column();
cs2.MappingName ="STEP_DESCRIPT ION";
cs2.HeaderText= "STEPX_DESCRIPT ION";
cs2.Alignment=H orizontalAlignm ent.Center;
cs2.Width=200;
ts.GridColumnSt yles.Add(cs2);
// Add the tablestyle to the datagrid adn bind
dataGrid1.Table Styles.Add(ts);
dataGrid1.DataS ource=data;
currencyManager = (CurrencyManage r)dataGrid1.Bin dingContext[data];
Thanks for any help you can give
Jim
"Darryn Ross" wrote:
I have had a number of problems with custom styles but to help you please
attach code for reviewal
"Jim Dougherty" <Ji**********@d iscussions.micr osoft.com> wrote in message
news:79******** *************** ***********@mic rosoft.com... I am using c#.net 2003 and have an an application with a datagrid. The
binding is with an array of structs. Everything works ok except the header
text is the struct element names and they override any GridColumnStyle s
properties I set. Additionally, the GridColumnStyle s width I set does not
get updated on the datagrid. Any other user have this problem or some insight
into what may be going on.
Thanks,
Jim