Solved

When disabling dropdownlist - get rid of down icon?

Posted on 2011-09-19
5
241 Views
Last Modified: 2012-05-12
When disabling dropdownlist - is there a way to get rid of down arrow icon on the right end of the control?

  case "System.Web.UI.WebControls.DropDownList":
                        ((System.Web.UI.WebControls.DropDownList)cc).BorderWidth = 0;
                        ((System.Web.UI.WebControls.DropDownList)cc).Enabled = !value;
                        ((System.Web.UI.WebControls.DropDownList)cc).BackColor = System.Drawing.Color.Transparent;


//////////////////////////////  GET RID OF "down" indicator?

                        break;
0
Comment
Question by:knowlton
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:Jesse Matlock
ID: 36563850
To my knowledge,. this is not possible. You can, to some extent change the 'look' of a select element via front or backend styling.. . but browsers do not support the removal or modification of that portion of the select element. The best option would be to create a list of options you want to use, and then modify the look/design of it using CSS, etc.
0
 
LVL 8

Expert Comment

by:Jesse Matlock
ID: 36563862
Alternatively, you can use a Javascript plugin to your preferred lib. and have that control the look/design of your select elements. Essentially, what most of them do is to create and restyle an additional element (eg. a list of items) and pass the 'click' to the hidden, but active, original select element. What JS Lib are you using?
0
 
LVL 5

Author Comment

by:knowlton
ID: 36563898
>>>>What JS Lib are you using?

jQuery

I just love jQuery.  It's the first time in a while I've had FUN doing web development!!!  I love it's power and simplicity.

I could just find-out what option value is "selected", then hide the entire drop down list or even replace it with a <span> that would have the option value from the dropdown as it's inner html.

But first I want to find an asp.net C# solution if there is one...since I already have it doing the disabling for the textboxes.
0
 
LVL 8

Accepted Solution

by:
Jesse Matlock earned 500 total points
ID: 36563941
Me too.. it's always my first stop for JS candy LOL.

To keep usability as high as possible, I would highly recommend checking into this plugin: https://github.com/fnagel/jquery-ui (this is an extended version of Filament Groups plugin here: http://www.filamentgroup.com/lab/jquery_ui_selectmenu_an_aria_accessible_plugin_for_styling_a_html_select/)

It handles all the things needed for a well executed, and cleanly styled select element (eg. still accessible to screen readers, styling is infinitely adjustable.. etc.)

I hope that helps answer the question and most importantly helps you great a killer UI for your users !!
0
 
LVL 5

Author Closing Comment

by:knowlton
ID: 36567878
thx
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

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

22 Experts available now in Live!

Get 1:1 Help Now