Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ToolTip

Thread Tools


Jim Heavey
Posts: n/a
Hello, I am looking a coding example that allows you to add toolTips to a
column in a datagrid. It works just fine ins the supplied code, but when I
attempt to apply it to my program, it fails with a out of bounds exception.

The example is applying toolTip to a HyperLinkColumn, which is the first
column in the datagrid, and I am attempting to apply it to a "BoundColumn".

Here is the code...
Dim liType As ListItemType = e.Item.ItemType
If liType = ListItemType.Item Or liType = ListItemType.AlternatingItem Then
Dim drv As DataRowView = CType(e.Item.DataItem, DataRowView)
Dim cellValue = e.Item.Cells(0).Text
Dim control As Control = e.Item.Cells(0).Controls(0)
CType(e.Item.Cells(0).Controls(0), WebControl).ToolTip = "My Custom
End If

Last line of the If Statement is the one failing. I looked at the
"WebControl" class and BoundColumn is one of the controls apllicable. Why is
it failing?

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How could I add a tooltip to an iframe ? Also, the tooltip contents has to be determine @ run-time ! Radu ASP .Net 1 01-08-2007 04:11 PM
show subitem text of listview control in tooltip Lucky ASP .Net 0 12-22-2005 07:04 AM
Tooltip Text Display? Majordomo Firefox 3 11-11-2004 09:45 PM
Web Custom Control - Tooltip and Rendering within IDE Steve R ASP .Net 0 10-30-2003 05:12 PM
Re: Question: How to get more info on tooltip error/squiggly VB Programmer ASP .Net 1 07-01-2003 07:42 PM