Another way is to define the column your self that way you know for shaw the
heading corresponds to the correct data see below:
//disable auto column generation
MyGridView.AutoGenerateColumns = false;
//define id column
BoundField field = new BoundField();
field.DataField = "Id";
field.HeaderText = "TestId";
MyGridView.Columns.Add(field);
//define Name column
field.DataField = "Name";
field.HeaderText = "TestName";
MyGridView.Columns.Add(field);
MyGridView.DataSource = _myDataSource;
MyGridView.DataBind();
"Prashanth Rao" wrote:
Jason,
You can change the header text of the GridView column by:
GridView1.Columns[0].HeaderText = "ID";
Regards,
Prashanth.
On May 16, 1:28 pm, "Jason Huang" <JasonHuang8...@hotmail.comwrote:
Hi,
Would someone tell me how to manipulate the Header of a GridView?
My DataSet is like this:
_id _name
1 John
2 Mary
But I want the GridView in my webform to show up like this:
ID Name
1 John
2 Mary
Thanks for help.
Jason