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

Exclude a class from FormDecorator

1 Answer 64 Views
FormDecorator
This is a migrated thread and some comments may be shown as answers.
Michael Davis
Top achievements
Rank 1
Michael Davis asked on 09 Aug 2011, 02:59 AM
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!

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 09 Aug 2011, 09:06 AM
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.
Tags
FormDecorator
Asked by
Michael Davis
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or