Checkbox labels

3 posts, 0 answers
  1. jorge
    jorge avatar
    23 posts
    Member since:
    Apr 2007

    Posted 16 Sep 2009 Link to this post

    Is there a trick to have the check box labels decorated?  A very simple dialog box, but the labels for check boxes seem untouched by the decorator.  We are using the "Hay" skin, declared in the webconfig.

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="printDialog.aspx.vb" Inherits="printDialog" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     
    <html xmlns="http://www.w3.org/1999/xhtml">  
    <head runat="server">  
        <title>Print Options</title> 
    </head> 
    <body> 
        <form id="form1" runat="server">  
        <div> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
        </telerik:RadScriptManager> 
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All" /> 
        <script language="javascript" type="text/javascript">  
     
            function GetRadWindow() {  
                var oWindow = null;  
                if (window.radWindow) oWindow = window.radWindow;  
                else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;  
                return oWindow;  
            }  
     
            function returnToParent() {  
                //create the argument that will be returned to the parent page  
                var oArg = new Object();  
     
                oArg.showTitle = document.getElementById("chkTitle").checked;  
                oArg.pageTitle = $find("txtTitle").get_value();  
                oArg.showLegend = document.getElementById("chkLegend").checked;  
                oArg.showNorthArrow = document.getElementById("chkNA").checked;  
     
     
                //get a reference to the current RadWindow  
                var oWindow = GetRadWindow();  
     
                //Close the RadWindow and send the argument to the parent page  
                oWindow.close(oArg);  
            }  
     
            function onCancel() {  
                var oWindow = GetRadWindow();  
                oWindow.argument = null;  
                oWindow.close();  
            }  
     
            function onCheckChanged_chkTitle() {  
                if (document.getElementById("chkTitle").checked) {  
                    $find("txtTitle").enable();  
                }  
                else {  
                    $find("txtTitle").disable();  
                }  
            }  
     
        </script> 
            <table> 
                <tr> 
                    <td> 
                        <asp:CheckBox ID="chkTitle" runat="server" Text="Show Title?" /> 
                    </td> 
                </tr> 
                <tr> 
                    <td>&nbsp;&nbsp;&nbsp;  
                        <telerik:RadTextBox ID="txtTitle"   
                                            runat="server"   
                                            Label="Title"   
                                            Enabled="false"   
                                            MaxLength="50" 
                                            Width="250px">  
                        </telerik:RadTextBox>                  
                    </td> 
                </tr> 
                 <tr> 
                    <td> 
                        <asp:CheckBox ID="chkLegend" runat="server" Text="Show Legend?" on /> 
                    </td> 
                </tr> 
                <tr> 
                    <td> 
                        <asp:CheckBox ID="chkNA" runat="server" Text="Show North Arrow?" /> 
                    </td> 
                </tr> 
           </table> 
           <br /> 
           <table> 
            <tr> 
                <td> 
                    <asp:Button ID="btnOK" runat="server" Text="Print" OnClientClick="returnToParent(); return false;" /> 
                </td> 
                <td> 
                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" OnClientClick="onCancel(); return false;" /> 
                </td> 
            </tr> 
           </table> 
        </div> 
        </form> 
    </body> 
    </html> 
     

     
    Partial Class printDialog  
        Inherits System.Web.UI.Page  
     
        Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
            chkTitle.Attributes.Add("onclick""onCheckChanged_chkTitle();")  
        End Sub 
    End Class 
  2. jorge
    jorge avatar
    23 posts
    Member since:
    Apr 2007

    Posted 22 Sep 2009 Link to this post

    Anybody?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Martin
    Admin
    Martin avatar
    585 posts

    Posted 23 Sep 2009 Link to this post

    Hello jorge,

    The result you need can be achieved with CSS:

    <style type="text/css">
    .RadForm_Hay label
    {
     color: red !important;
    }

    .RadForm_Hay label:hover
    {
     color: green !important;
    }
    </style>


    All the best,

    Martin Ivanov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top