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
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.
Re: Change datagrid header from code behind
Quoting myself...
Quote:
Can someone give me an example of some code that will do this from the VB code behind?
Re: Change datagrid header from code behind
If e.Item.ItemType = ListItemType.Header Then
e.Item.Cells(0).Text = "SOMETHING"
End If