|
-
Apr 26th, 2006, 08:38 AM
#1
Thread Starter
Fanatic Member
Change datagrid header from code behind
I have a dtagrid called datagrid1. When I have my code behind process run I want to be able to change the header text of the datagrid from there.
Can someone give me an example of some code that will do this from the VB code behind?
I'm using VS .Net 2003.
Thanks
-
Apr 26th, 2006, 11:07 AM
#2
Re: Change datagrid header from code behind
In the ItemDataBound event, first check whether e.ItemType = Header.
If it is a header, then you can simply access e.Item[0] (or any numeric value) and change its text property or innerhtml or innertext property.
-
Apr 26th, 2006, 01:30 PM
#3
Thread Starter
Fanatic Member
Re: Change datagrid header from code behind
Quoting myself...
Can someone give me an example of some code that will do this from the VB code behind?
-
Apr 28th, 2006, 04:19 AM
#4
Re: Change datagrid header from code behind
If e.Item.ItemType = ListItemType.Header Then
e.Item.Cells(0).Text = "SOMETHING"
End If
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|