How to change the title text of DataGrid's column?

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

Hello,
The DataGrid binds to a typed dataset,
how can I change the title text of DataGrid's column?

Thanks!
 
Michael said:
Hello,
The DataGrid binds to a typed dataset,
how can I change the title text of DataGrid's column?

Thanks!

this change HeaderText on column 2 of datagrid dtGrid


DataGrid dtGrid ;

dtGrid.TableStyles[0].GridColumnStyles[2].HeaderText
 
Michael said:
Hello,
The DataGrid binds to a typed dataset,
how can I change the title text of DataGrid's column?

Thanks!
Or try using DataGridTableStyle

DataGridTableStyle ts = new TataGridTableStyle();
ts.MappingName = "Table" ;
....
DataGridColumnStyle colDate = new DataGridTextBoxColumn();
colDate.MappingName = "ShipDate" ;
colDate.HeaderText = " Date of shiping" ;
colDate.Width = 90 ;
ts.GridColumnStyles.Add( colDate ) ;
dtGrid.TableStyles.Add( ts ) ;
 
Back
Top