Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Set headertext in datagrid programatically (http://www.velocityreviews.com/forums/t79152-set-headertext-in-datagrid-programatically.html)

=?Utf-8?B?bWc=?= 05-26-2004 07:06 PM

Set headertext in datagrid programatically
 
I create a datagrid using the Web Forms Toolbo

The dataadapter,dataset and databind() code runs in a button eventhandler

The headertext is currently determined by the column names of my SQL select statement there

How can I change the headertext programatically in the codebehind? ... I don't want to change the preexisting code if at all possible.

Alvin Bruney [MVP] 05-27-2004 05:02 AM

Re: Set headertext in datagrid programatically
 
in your itemdatabound event handler, you can test for the headeritem and
then use the text property attached to the cell object to change the text
e.item.cells[4].text = "vapor"

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
"mg" <mg@theworld.com> wrote in message
news:88A2B342-0B07-4CD5-80AC-8C989FE5C2EA@microsoft.com...
>I create a datagrid using the Web Forms Toolbox
>
> The dataadapter,dataset and databind() code runs in a button eventhandler
>
> The headertext is currently determined by the column names of my SQL
> select statement there.
>
> How can I change the headertext programatically in the codebehind? ... I
> don't want to change the preexisting code if at all possible.





All times are GMT. The time now is 07:57 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.