how to add a tooltip a the datagrid header?

F

Franck

hello,
I'm trying to add a tooltip at the datagrid header but
I don't know where to start?

I tought about a template column
but i only wish to have the tooltip on the header?

any help?
thank you
 
S

S.M. Altaf [MVP]

In the ItemCreated event for the datagrid, check for e.ItemType

If e.ItemType = ListItemType.Header, then simply do this:

e.Item.Cells(0) = "Id"
e.Item.Cells(1) = "Name"
e.Item.Cells(2) = "Cigarettes Per Day"

HTH
S.M. Altaf
[MVP - VB]
 
F

Franck

thanks a lot!
:)
S.M. Altaf said:
In the ItemCreated event for the datagrid, check for e.ItemType

If e.ItemType = ListItemType.Header, then simply do this:

e.Item.Cells(0) = "Id"
e.Item.Cells(1) = "Name"
e.Item.Cells(2) = "Cigarettes Per Day"

HTH
S.M. Altaf
[MVP - VB]


--------------------------------------------------------------------------------
All that glitters has a high refractive index.
www.mendhak.com



hello,
I'm trying to add a tooltip at the datagrid header but
I don't know where to start?

I tought about a template column
but i only wish to have the tooltip on the header?

any help?
thank you
 
B

Brock Allen

You can handle the DataBound event on the DataGrid. This is fired after each
row is created. The event is passed the row that was just created so you
can see if it's the header row. If it is, then you can drill into its Controls
collection and then modify them however you want (by adding the tooltip via
an attribute).
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top