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

How to change forecolor of checkbox when checkboxes were decorated by RadFormDecorator?

1 Answer 637 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
Robin
Top achievements
Rank 2
Robin asked on 07 Jun 2013, 06:30 AM
Hello, 

I can't change forecolor of checkbox label.
I tried to set ForeColor of checkbox, I tried to overwrite color in checkbox inline style, I tried overwrite .radCheckboxChecked.
May be I'm overwriting wrong class. Please help.
Skin for my checkboxes is "Sitefinity" which was defined in RadFormDecorator.

ASPX
<telerik:RadFormDecorator ID="RFDCheckBoxes" runat="server" 
DecoratedControls ="CheckBoxes"Skin="Sitefinity" EnableRoundedCorners="false" />

<asp:CheckBox ID="chkSelect" runat="server" AutoPostBack="false" Text="Select" ForeColor="White"/>
<asp:CheckBox ID="chkSelect2" runat="server" AutoPostBack="false" style="color:white!important;"Text="Select 2"/>

CSS
.RadForm_Sitefinity.radfdCheckboxChecked {color: white!important;}
.RadForm_Sitefinity.radfdCheckboxUnchecked {color: white !important;}


Thanks in advanced.
Robin

1 Answer, 1 is accepted

Sort by
0
Accepted
Bozhidar
Telerik team
answered on 11 Jun 2013, 07:02 AM
Hello,

This should be done with CSS, but as I could see, you are using wrong CSS class (radfdCheckboxChecked - the prefix should be rfd) and wrong CSS cascade (the cascade should be .RadForm_Sitefinity.rfdLabel label). To change the checkbox text color, you should use the following code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <style type="text/css">
    .RadForm_Sitefinity.rfdLabel label {
        color: red !important;
    }
    </style>
</head>
<body>
    <form id="Telerik" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadFormDecorator runat="server" DecoratedControls="All" Skin="Sitefinity" />
    <asp:CheckBox runat="server" Text="ASP Checkbox" />
    <asp:CheckBox ID="CheckBox1" runat="server" Text="ASP Checkbox Checked" Checked="true" />
    <br /><br />
    <input type="checkbox" /><label>input checkbox</label>
    <input type="checkbox" checked="checked" /><label>input checkbox checked</label>
    </form>
</body>
</html>


Regards,
Bozhidar
Telerik
Explore the entire set of ASP.NET AJAX controls we offer here and browse the myriad online demos to learn more about the components and the features they incorporate.
Tags
FormDecorator
Asked by
Robin
Top achievements
Rank 2
Answers by
Bozhidar
Telerik team
Share this question
or