Skip to content

How to change color of read only dropdownlist on ie9

gavriel ankri

Asked Apr 12, 2012, 9:35 PM EDT1 answer
Share
LinkedInX
Hello

I am trying to change the fore color of read only dropdownlist.

its work fine with firefox and chrome, but not in internet explorer 9
someone know how to solve the problem ?

this is my code:

  <asp:DropDownList ID="ProblemTypeIDdrp" runat="server"
  DataSourceID="EntityDataSource1" DataTextField="ProblemName"
  DataValueField="ProblemTypeID" SelectedValue='<%# Bind("ProblemTypeID") %>'
  Enabled="False" Font-Bold="True"  ForeColor="#6666FF">
  </asp:DropDownList>

thank you

1 Answer

Know the answer? Post it. Somebody with the same question will find it here.

  • Senthilkumar
    0
    Hi Ankri,

    usually the internet explorer will not allow to change the color property in the disabled control.

    In Internet Explorer 9, support will be added for the :disabled pseudo-selector (ref). I don't know whether that will honor the "color" property, but it seems likely.

    In older versions of IE, you can adjust the background color (but not the color). Thus:

        <style type="text/css">
            select[disabled] { background-color: blue; }
        </style>

    That works in IE 7 and IE 8. You still can't alter the foreground color, but you can change the background color to contrast more strongly with the gray that IE assigns it when it's disabled.
    0