Gopal
Gopal

Reputation: 11972

Changing the Header value in Grid View

Using VS2005

I am using Gridview in my web page, when i load the web page, the table header also displaying in the GridView. So i want to give my different header name in datagridview.

So how to change the setting in datagridview.

Upvotes: 0

Views: 213

Answers (2)

anishMarokey
anishMarokey

Reputation: 11397

you want to add

<HeaderTemplate> Name </HeaderTemplate>

Upvotes: 0

Pranay Rana
Pranay Rana

Reputation: 176896

set HeaderText="FirstName" property of you column as below

 <asp:BoundField HeaderText="FirstName" DataField="FirstName" SortExpression="FirstName"
                                            ReadOnly="true" HeaderStyle-Width="120px" ItemStyle-Width="120px" />

Upvotes: 1

Related Questions