This is a migrated thread and some comments may be shown as answers.

How to set radtextbox DisabledStyle using css

2 Answers 313 Views
Input
This is a migrated thread and some comments may be shown as answers.
Nalini
Top achievements
Rank 1
Nalini asked on 12 Aug 2010, 04:34 PM

How can I set the RadTextBox disabled style using .css file? Somehow the style is not being recognized.

<telerik:RadTextBox ID="RadTextBox1" runat="server" Text="Johnson Grammer" Skin="Office2007">
<DisabledStyle CssClass="disableField" />
</telerik:RadTextBox>

My style sheet entries. I tried both but didn't work. What am i doing wrong?

.disableField .RadInput .riTextBox  

{
background-color: #EFEFEF;
font-weight: bold;
}

 
.disableField1
{
 background-color: #EFEFEF;
 font-weight: bold;
 }

I could achieve this by doing like this but I would like to use the.css so I can change at once.

<telerik:RadTextBox ID="RadTextBox1" runat="server" Text="Johnson Grammer" Skin="Office2007">
        <DisabledStyle BackColor="#EFEFEF" BorderColor="Black" Font-Bold="True" />
</telerik:RadTextBox>

I found a style sheet example for Radcombobox from Telerik site which works great for RadComboBox. But was not able to get it work for text box.
http://www.telerik.com/help/aspnet-ajax/appearance-change-input-look-tutorial.html

Thanks in Advance.

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 13 Aug 2010, 09:23 AM
Hi Nalini,

Your CSS rules to not work for two reasons:

+ the first one contains an invalid selector. The disableField CSS class is applied to the same HTML element as the riTextBox CSS class, not to same wrapper above the element with a RadInput CSS class. You should use

html  body  form  .RadInput  .disableField
{
    background-color: #EFEFEF;
    font-weight: bold;
}


+ the second one has a too low CSS specificity (10), compared to the skin's specificity (22)

http://blogs.telerik.com/dimodimov/posts/08-06-17/how_to_override_styles_in_a_radcontrol_for_asp_net_ajax_embedded_skin.aspx

Also refer to:

http://www.telerik.com/help/aspnet-ajax/input_appearancecssfile.html

Best wishes,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Nalini
Top achievements
Rank 1
answered on 13 Aug 2010, 01:15 PM
Thanks a bunck. It worked.
Tags
Input
Asked by
Nalini
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Nalini
Top achievements
Rank 1
Share this question
or