Change HeaderText in datagrid

  • Thread starter Øyvind Isaksen
  • Start date
Ø

Øyvind Isaksen

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!!!
 
E

Eliyahu Goldin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top