how to add a tooltip a the datagrid header?

  • Thread starter Thread starter Franck
  • Start date Start date
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
 
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]
 
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
 
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).

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
Back
Top