Solved

DropDownList backcolor only on first item??

Posted on 2004-10-08
2
453 Views
Last Modified: 2011-09-20

Hello. I dynamically build a drop down list inside of a datagrid that I want to apply a backcolor to. Right now I'm applying the color to the entire dropdown, but is it possible to apply the color only to the first item in the drop down list? I will always want only the first one highleighted regardless of what name/value pair happens to be the first item. It would look nicer than having the entire thing colored when expanding the list

Here is how I'm building the list:

ddl.DataSource = ds;
ddl.DataTextField = "product_shortdesc";
ddl.DataValueField = "pproduct_id";
ddl.Visible = true;
ddl.BackColor = Color.Yellow;
ddl.DataBind();

thanks in advance!!
0
Comment
Question by:animated405
2 Comments
 
LVL 20

Accepted Solution

by:
TheAvenger earned 250 total points
ID: 12274347
Is this ASP.NET? If yes, it is not possible. You can try to render the elements in several controls, but you will lose the functionality of the DropDownList, so I don't think there is a practical possibility to do that.
0
 

Author Comment

by:animated405
ID: 12274743

thank you.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Programmatically signing Word macros 4 61
Why Does This Page Not Show Up? 4 24
Class object 2 27
C# 2015 Downloading text file and preserving the line breaks 5 20
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now