Datagrid + Tooltip question

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
 
R

Raterus

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
 
R

Rick Spiewak

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

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

Similar Threads

Tooltip question 5
ToolTip in a bound datagrid 1
Tooltip on cell in DataGrid? 1
Listbox and tooltip 0
datagrid column question 2
Tooltip question 8
Question about my projects 3
Tooltip question 1

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top