Changing datagrid header text

H

Herry

Hi all,
I have problem with datagrid in asp.net using vb as the
language. This is how I show the datagrid from database

datagrid1.datasource = dataset1
datagrid1.DataBind()

Is there any possibility to change the header on every
column and how to set the column width

Thanks
 
E

Eliyahu Goldin

You mean you are using autogenerated columns. The only way to change header
columns is to handle ItemCreated event. You can detect header item, get
access to the cells and change their text and width.

Eliyahu
 
H

Herry

Hi Eliyahu

I dont understand how to use ItemCreated event.
can u show me the code to change the header.

Thanks a lot
 

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,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top