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

2 posts, 1 answers
  1. Robin
    Robin avatar
    41 posts
    Member since:
    Sep 2012

    Posted 07 Jun 2013 Link to this post


    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.

    <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"/>

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

    Thanks in advanced.
  2. Answer
    Bozhidar avatar
    693 posts

    Posted 11 Jun 2013 Link to this post


    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" "">
    <head runat="server">
        <style type="text/css">
        .RadForm_Sitefinity.rfdLabel label {
            color: red !important;
        <form id="Telerik" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <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>

    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.
Back to Top