Exclude a class from FormDecorator

2 posts, 0 answers
  1. Michael Davis
    Michael Davis avatar
    9 posts
    Member since:
    Feb 2010

    Posted 08 Aug 2011 Link to this post

    Hi,
    I was wondering if it is possible to exclude a specific css class from being decorated? I have multiple radio buttons on the page and I would only like to style one set.
    Thanks!
  2. Bozhidar
    Admin
    Bozhidar avatar
    679 posts

    Posted 09 Aug 2011 Link to this post

    Hello Michael,

    If you want to skip the decoration of all controls on the page, you could use the ControlsToSkip property:

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!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>
    </head>
    <body>
        <form id="form1" method="post" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadSkinManager ID="rskm1" runat="server" ShowChooser="true">
        </telerik:RadSkinManager>
        <br />
        <br />
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All" ControlsToSkip="RadioButtons" />
        <asp:RadioButtonList ID="rb1" runat="server">
            <asp:ListItem Text="lsit 1"></asp:ListItem>
            <asp:ListItem Text="lsit 2"></asp:ListItem>
            <asp:ListItem Text="lsit 3"></asp:ListItem>
        </asp:RadioButtonList>
        </form>
    </body>
    </html>

    However, if you like to usually decorate radiobuttons, but to skip only a group of radiobuttons, you could do that by using decoration zones:

    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <!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>
    </head>
    <body>
        <form id="form1" method="post" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All"
            DecorationZoneID="ButtonsDecorated" Skin="Black" />
        <telerik:RadFormDecorator ID="RadFormDecorator2" runat="server" DecoratedControls="All"
            ControlsToSkip="RadioButtons" DecorationZoneID="ButtonsNotDecorated" Skin="Black" />
        <div id="ButtonsDecorated">
            <fieldset>
                <legend>Decorated Radio Buttons</legend>
                <asp:RadioButtonList ID="rb1" runat="server">
                    <asp:ListItem Text="lsit 1"></asp:ListItem>
                    <asp:ListItem Text="lsit 2"></asp:ListItem>
                    <asp:ListItem Text="lsit 3"></asp:ListItem>
                </asp:RadioButtonList>
            </fieldset>
        </div>
        <div id="ButtonsNotDecorated">
            <fieldset>
                <legend>Not Decorated Radio Buttons</legend>
                <asp:RadioButtonList ID="RadioButtonList1" runat="server">
                    <asp:ListItem Text="lsit 1"></asp:ListItem>
                    <asp:ListItem Text="lsit 2"></asp:ListItem>
                    <asp:ListItem Text="lsit 3"></asp:ListItem>
                </asp:RadioButtonList>
            </fieldset>
        </div>
        </form>
    </body>
    </html>

    I have used for the example Telerik Black embedded skin in order to make the visual appearance more clear.

    Greetings,
    Bojo
    the Telerik team
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top