Tooltip in a RadioButtonList

G

Greg

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
 
B

Bruno Piovan

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
 
G

Greg

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
 

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

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,815
Latest member
treekmostly22

Latest Threads

Top