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

M

Michael

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

Thanks!
 
G

Geni

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
 
G

Geni

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 ) ;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top