Set headertext in datagrid programatically

G

Guest

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.
 
A

Alvin Bruney [MVP]

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"
 

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

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,810
Latest member
Kassie0918

Latest Threads

Top