ToolTip

Discussion in 'ASP .Net' started by Jim Heavey, Oct 17, 2003.

  1. Jim Heavey

    Jim Heavey Guest

    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
    ToolTip"
    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?
    Jim Heavey, Oct 17, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lucky
    Replies:
    0
    Views:
    2,398
    Lucky
    Dec 22, 2005
  2. VB Programmer
    Replies:
    1
    Views:
    347
    Steve C. Orr, MCSD
    Jul 1, 2003
  3. Steve R
    Replies:
    0
    Views:
    591
    Steve R
    Oct 30, 2003
  4. drb

    Tooltip on AREA object

    drb, Nov 27, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    302
  5. Radu
    Replies:
    1
    Views:
    543
    Bruce Barker
    Jan 8, 2007
Loading...

Share This Page