tags:

views:

1389

answers:

2

I have an asp:DropDownList on a page that, due to the 1024x768 development standard can truncate some of the text values in the dropdown (not enough of them, apparently, to redesign the layout ), so I need to display a tooltip of the selected value when a dropdown item is being selected (i.e. when the dropdown is shown and an item is being hovered over), preferably only when the text for that item is being truncated.

Is this possible by default, javascript hacking or only my imagination?

A: 

Add the "Title" attribute to your list items with your tooltip info in there. It's not an existing item in the intellisense, but it should work. It does on my system. Now, I'm not exactly sure how to do this if you're DataBinding your drop down list to a data source. But if you're hard coding in the ASPX or in the codebehind, that's how you can do it.

<asp:DropDownList id="ddl1" runat="server">
  <asp:ListItem Text="Display text" Value="1" Title="This is my tooltip"></asp:ListItem>
</asp:DropDownList>
BenAlabaster
Cheers, but didn't work unfortunately, what system/browser you running on?
johnc
I'm using Windows XP(SP3)/Internet Explorer 7.0.5730.11/Visual Studio 2008(SP3). I hadn't noticed if this was not working in FireFox/Safari/Opera though, I have to be honest and admit that I didn't test the theory in those browsers.
BenAlabaster
A: 

You could also do a postback and load data into a help icon. boxover works pretty well.