Solved

When disabling dropdownlist - get rid of down icon?

Posted on 2011-09-19
5
242 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 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