Link to home
Start Free TrialLog in
Avatar of Poidda
Poidda

asked on

ToolTip on DropDownList

Hi Experts,

In AsP.NET I am wanting to put a tooltip on a DropDownList so that the true value of the ListItem is displayed.  The reason I want to do this is because a couple of Items in the DropDownList are to long and throws the page format.  So I'm Limiting the length of the DropDownBox to 200px and therefore some Items are truncated but I need to see the full description.

Thanks Heaps,
Peter
Avatar of GoodJun
GoodJun

That's not a tooltip. Are you want to display the info when you hightlight the item or when the mouse stays over an item for a while?
Set autopostback to true and then on Selected inted chane event try

Me.ToolTip1.SetToolTip(Me.dd, dd.SelectedItem.Text)
Avatar of Poidda

ASKER

Thanks GoodJun.  Either of these will do the trick.  Preferably on a mouse over, but the other will do.

iboutchkine.  I don't want to do a post back at this stage if i can help it.
for highlight, ibout's code should work.
for a mouse over, will need javascript code to do it. I have the code somewhere just need to dig to find it.
not sure but maybe of some help to you

http://www.codeproject.com/combobox/cexlistboc.asp

Arvind
a server side code, just see if it can be of some use

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        ListBox1.ToolTip = ListBox1.SelectedItem.Value
    End Sub

Arvind
oops sorry it doesnt work
ASKER CERTIFIED SOLUTION
Avatar of _TAD_
_TAD_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
HI,
THe Accepted answer still needs a click to be done for the tooltip to appear.Is there any way we can actually catch the event where we move the mouse over the listItems of the DropDownList so that on that event we can actually call the JavaScript function and show the full text of the List Item in  the ToolTip.