Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Tooltip in a RadioButtonList

Reply
Thread Tools

Tooltip in a RadioButtonList

 
 
Greg
Guest
Posts: n/a
 
      08-28-2007
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
 
Reply With Quote
 
 
 
 
Bruno Piovan
Guest
Posts: n/a
 
      08-29-2007
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
 
Greg
Guest
Posts: n/a
 
      08-29-2007
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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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

>
>
>

 
Reply With Quote
 
 
 
Reply

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
ToolTip Jim Heavey ASP .Net 0 10-17-2003 03:50 AM
Re: Question: How to get more info on tooltip error/squiggly VB Programmer ASP .Net 1 07-01-2003 07:42 PM



Advertisments