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
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
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)
Me.ToolTip1.SetToolTip(Me.
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.
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.
for a mouse over, will need javascript code to do it. I have the code somewhere just need to dig to find it.
a server side code, just see if it can be of some use
Private Sub ListBox1_SelectedIndexChan ged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChan ged
ListBox1.ToolTip = ListBox1.SelectedItem.Valu e
End Sub
Arvind
Private Sub ListBox1_SelectedIndexChan
ListBox1.ToolTip = ListBox1.SelectedItem.Valu
End Sub
Arvind
oops sorry it doesnt work
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.