Datagrid + Tooltip question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a datagrid on a web page that has several columns in it.

Is there a way to provide a tooltip for each of the columns (i.e. to say how
they were calculated or what a specific literal in the column means)?

Thanks

SC
 
Sure, if you want to have decent looking popups, pick your javascript code, http://www.walterzorn.com/tooltip/tooltip_e.htm this one for example, and work it into the ItemDataBound event the datagrid uses.

If e.Item.ItemType = ListItemType.Header Then

Dim td as tableCell = ctype(e.item.cells(?), tableCell)

'whatever it takes to make html like you need it from this point

End If
 
In the itemcreated event, if the item type is header, look at the control
types. For autgenerated columns, they will be tablecells. In VB.Net, the
following code will give you access to their properties, including tooltip,
which you can just set in text:

directcast(e.Item.Controls(1),TableCell).ToolTip = "This column provides
useful information..."
 
Back
Top