Solved

When disabling dropdownlist - get rid of down icon?

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

791 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