Click here to Skip to main content
15,891,673 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
How to change the Background of tooltip in dropdownlist in asp.net c# ??
===================================================

I want to change the Background of item, which is mouseover in this dropdownlist items...


This is my code..

C#
private void Fill_Colleges()
    {

        SqlConnection con = new SqlConnection(_connString);
        con.Open();
       SqlCommand cmd = new SqlCommand("select * from Colleges ORDER BY College_Code", con);
      
       
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataSet ds = new DataSet();
        da.Fill(ds);
        DDLColleges.DataSource = ds;
        DDLColleges.DataTextField = "College_Code";
        DDLColleges.DataValueField = "CollegeName";
        DDLColleges.DataBind();

       DDLColleges.Items.Insert(0, new System.Web.UI.WebControls.ListItem("--------- Select ---------", "0"));

        con.Close();


    }




C#
protected void DDLColleges_DataBound(object sender, EventArgs e)
    {

        DropDownList ddl = sender as DropDownList;
        if (ddl != null)
        {
            foreach (ListItem li in ddl.Items)
            {
                li.Attributes["Title"] = li.Value.ToUpper();

                li.Attributes.Add("style", "color:#1B3E74");

            }
        }
    }



Please help me, thanks.
Posted
Updated 6-Nov-13 22:12pm
v2
Comments
thatraja 7-Nov-13 4:38am    
Background of item or tooltip?
Member239258 7-Nov-13 5:07am    
I want to change background color of Tooltip to #FDCB0A color

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900