• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 748
  • Last Modified:

Change the BorderStyle property of the DropDownList control (ASP.NET)

Hi, I want to get rid of the sunken border on the dropdownlist control.

MSDN says:
The BorderStyle property is inherited from the WebControl class and is not applicable to the DropDownList control.

Can this be done by changing the WebControl class?
0
sumo_the_cat
Asked:
sumo_the_cat
  • 2
  • 2
1 Solution
 
mmarinovCommented:
why don't you use
DropDownList.BorderStyle = BorderStyle.Outset
or
DropDownList.BorderStyle = BorderStyle.Ridge

B..M
0
 
sumo_the_catAuthor Commented:
? Doesn't do anything! Still getting the same sunken effect. I think it's as the documentation says: these properties are ignored for this control.
0
 
Timbo87Commented:
Yes, you cannot change the actual style of the drop down list, only its colors.
0
 
sumo_the_catAuthor Commented:
But is it not possible to change these properties in the WebControl class?
0
 
Timbo87Commented:
Well what it comes down to is the web browser (IE, Mozilla, etc). They only support one type of border style and because the ASP.NET controls are just wrappers of the HTML controls with CSS, they cannot be changed.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now