aspdotnet-suresh offers articles and tutorials,csharp dot net, articles and tutorials,VB.NET Articles,Gridview articles,code examples of 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

Show tooltip in Dropdownlist items Mouseover Event in C#, VB.NET

Oct 10, 2012

Here I will explain how to show tooltip in dropdownlist items on mouseover event in using C# and VB.NET.

In previous posts I explained Bind data to Dropdownlist from database, Bind Images to dropdownlist, Cascading dropdownlist example and many articles relating to dropdownlist, JQuery, etc. Now I will explain how to show tooltip in dropdownlist items on mouseover event in

To show tooltip in dropdownlist items on mousover we need to write the codesnippet like as shown below

Show tooltip in dropdownlist items mouseover event

C# Code

protected void ddlDetails_DataBound(object sender, EventArgs e)
DropDownList ddl = sender as DropDownList;
foreach (ListItem li in ddl.Items)
li.Attributes["title"] = li.Text;

Protected Sub ddlDetails_DataBound(ByVal sender As Object, ByVal e As EventArgs)
Dim ddl As DropDownList = TryCast(sender, DropDownList)
If ddl IsNot Nothing Then
For Each li As ListItem In ddl.Items
li.Attributes("title") = li.Text
End If
End Sub

If you want know the complete source code please check below post

Bind or add tooltip for dropdownlist items in  

Above post will explain clearly how to bind tooltip for dropdownlist items in using C# and VB.NET.

If you enjoyed this post, please support the blog below. It's FREE!

Get the latest,, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email


Irfan said...

Wish there was an easier way to do this, such as

ddl.DataValueField = "ID";
ddl.DataTextField = "Text";
ddl.DataToolTipField = "Description"; //this would have been sweet

Anonymous said...

my dropdownlist object doesnot showing DataToolTipField property

Anonymous said...

require month and year using dropdownlist in gridview
pls reply me

udham Singh said...

hi suresh,

i want to show tooltip on mouseover of repeater control in using javascript.

i am searching for that from last 1 day and still searching.

so please help...

Give your Valuable Comments

Other Related Posts

© 2015 All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.