Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP .Net (http://www.velocityreviews.com/forums/f29-asp-net.html)
-   -   Change HeaderText in datagrid (http://www.velocityreviews.com/forums/t112918-change-headertext-in-datagrid.html)

Řyvind Isaksen 11-06-2005 12:42 PM

Change HeaderText in datagrid
 
Hi friends!

I have a Datagrid with AutoGenerateColumns = True.
How can I rename the headertext without using ASP:BoundColumn? I dont want
to show the database names, but make my own header names. I also need to
have the AutoGenerateColumns = True.

I Use VB.net :)


Thanks!!!







Eliyahu Goldin 11-06-2005 02:19 PM

Re: Change HeaderText in datagrid
 
With AutoGenerateColumns = True your only chance to catch header text is the
ItemCreated event. In the event handler you can catch the header by checking
e.Item.ItemType property, where e is the event argument of type
DataGridItemEventArgs. Once you detect the header, you can change the header
text as e.Item.Cells.Text.

Eliyahu

"Řyvind Isaksen" <oyvind@webressurs.no> wrote in message
news:OXj2h%23s4FHA.3668@tk2msftngp13.phx.gbl...
> Hi friends!
>
> I have a Datagrid with AutoGenerateColumns = True.
> How can I rename the headertext without using ASP:BoundColumn? I dont want
> to show the database names, but make my own header names. I also need to
> have the AutoGenerateColumns = True.
>
> I Use VB.net :)
>
>
> Thanks!!!
>
>
>
>
>
>





All times are GMT. The time now is 10:28 PM.

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