Tooltip in a RadioButtonList

Discussion in 'ASP .Net Web Controls' started by Greg, Aug 28, 2007.

  1. Greg

    Greg Guest

    Is there a way to set the tooltips of the individual items in a
    RadioButtonList?

    The RadioButtonList control has a ToolTip property, but that sets the
    tooltip for the entire control by setting the Title attribute of the
    containing table. I'd like to set a tooltip for each button.

    Thanks,
    Greg
     
    Greg, Aug 28, 2007
    #1
    1. Advertising

  2. Greg

    Bruno Piovan Guest

    Hi Greg,
    a quick way to do that would be to use a tag like span in the text property
    of each item, like:

    RadioButtonList1.Items.Add(New ListItem("<span title='ToolTip Here'>Text
    Here</span>", "value here"))

    or you can add the "title" attribute to the listitem class, like:

    Dim li As New ListItem("text here", "value here")
    li.Attributes.Add("title", "tooltip here")
    RadioButtonList1.Items.Add(li)
    this will cause a span tag to be rendered as well.

    I hope it helps,
    Bruno

    "Greg" <> wrote in message
    news:...
    > Is there a way to set the tooltips of the individual items in a
    > RadioButtonList?
    >
    > The RadioButtonList control has a ToolTip property, but that sets the
    > tooltip for the entire control by setting the Title attribute of the
    > containing table. I'd like to set a tooltip for each button.
    >
    > Thanks,
    > Greg
     
    Bruno Piovan, Aug 29, 2007
    #2
    1. Advertising

  3. Greg

    Greg Guest

    Bruno,

    Thanks so much! I added the title attribute and the individual tooltips
    showed up just as I'd been trying to do! I'd just about given up on it...

    Thanks again!
    Greg


    "Bruno Piovan" wrote:

    > Hi Greg,
    > a quick way to do that would be to use a tag like span in the text property
    > of each item, like:
    >
    > RadioButtonList1.Items.Add(New ListItem("<span title='ToolTip Here'>Text
    > Here</span>", "value here"))
    >
    > or you can add the "title" attribute to the listitem class, like:
    >
    > Dim li As New ListItem("text here", "value here")
    > li.Attributes.Add("title", "tooltip here")
    > RadioButtonList1.Items.Add(li)
    > this will cause a span tag to be rendered as well.
    >
    > I hope it helps,
    > Bruno
    >
    > "Greg" <> wrote in message
    > news:...
    > > Is there a way to set the tooltips of the individual items in a
    > > RadioButtonList?
    > >
    > > The RadioButtonList control has a ToolTip property, but that sets the
    > > tooltip for the entire control by setting the Title attribute of the
    > > containing table. I'd like to set a tooltip for each button.
    > >
    > > Thanks,
    > > Greg

    >
    >
    >
     
    Greg, Aug 29, 2007
    #3
    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,401
    Lucky
    Dec 22, 2005
  2. VB Programmer
    Replies:
    1
    Views:
    349
    Steve C. Orr, MCSD
    Jul 1, 2003
  3. Jim Heavey

    ToolTip

    Jim Heavey, Oct 17, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    610
    Jim Heavey
    Oct 17, 2003
  4. Steve R
    Replies:
    0
    Views:
    594
    Steve R
    Oct 30, 2003
  5. Radu
    Replies:
    1
    Views:
    547
    Bruce Barker
    Jan 8, 2007
Loading...

Share This Page