How to exclude specific controls from RadDecorator

6 posts, 0 answers
  1. Nirav
    Nirav avatar
    48 posts
    Member since:
    Sep 2008

    Posted 19 Jan 2011 Link to this post

    Hi, I have RadDecorator on my page but I want to exclude only couple of TextBoxes and couple of Labels where I want to apply my own CSS.

     

    <telerik:RadFormDecorator ID="FormDecorator1" runat="server" DecoratedControls="all"

     

     

    Skin="WebBlue"></telerik:RadFormDecorator>

     


    Now, I already applied CSSClass to my textbox but its not applying as I have formDecorator on my page as above.
    So How do I exclude specific controls from FormDecorator to apply my own CSS?

    Thanks in advance

  2. Bozhidar
    Admin
    Bozhidar avatar
    677 posts

    Posted 20 Jan 2011 Link to this post

    Hi Nirav,

    Hi if you want to exclude some specific elements no to be decorated by RadFromDecorator, you could put which controls to be decorated using DecoratedControls 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>
        <style type="text/css">
             
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="CheckBoxes, Buttons" Skin="Forest" />
        <asp:Button ID="btn1" runat="server" Text="Add New Event" /><br />
        <input type="checkbox" />Checkbox<br />
        <input type="radio" />Radio
        </form>
    </body>
    </html>

    In that specific scenario only Checkboxes and Buttons will be decoarated, while the radio button on the page will not be decorated and you will be able to style it using your own classes and CSS.

    Another option is to leave the property DecoratedControls set to All and to use ControlToSkip property to specify, which controls should not be decorated:

    <%@ 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>
        <style type="text/css">
             
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="All" ControlsToSkip="CheckBoxes" Skin="Forest" />
        <asp:Button ID="btn1" runat="server" Text="Add New Event" /><br />
        <input type="checkbox" />Checkbox<br />
        <input type="radio" />Radio
        </form>
    </body>
    </html>

    In that scenario only checkboxes will not be decorated and you will be able to style on you own choice.

    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
  4. Chris Griffin
    Chris  Griffin avatar
    18 posts
    Member since:
    May 2009

    Posted 20 Jan 2011 Link to this post

    I think the OP meant specific controls (i.e. cmdSubmit) not a certain type.  I have ran into this situation.
  5. Nirav
    Nirav avatar
    48 posts
    Member since:
    Sep 2008

    Posted 21 Jan 2011 Link to this post

    Thanks a lot Admin.
    Actually like I said, I am looking to exclude specific controls only, I mean not all the textboxes, only couple of textboxes on my form.
    Is it possible to exclude by giving that controlID ( textboxid or dropdownid).
    I want to exclude couple of textboxes of my screen, not all. For those textboxes, I need to apply my own CSS.
    so is there any way to exclude controls by giving ControlID ?

    Thanks again

  6. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 24 Jan 2011 Link to this post

    Hi Nirav,

    No, RadFormDecorator does not accepts specific IDs for decoration (or skipping one). What you could do is to wrap the rest of the controls (that you wish to decorate) in some container (DIV / SPAN) and set its ID as DecorationZone. RadFormDecorator will style the controls in the decoration zone only.


    Regards,
    Georgi Tunev
    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.
  7. Emanuele Zambrano
    Emanuele Zambrano avatar
    21 posts
    Member since:
    Dec 2009

    Posted 02 May 2011 Link to this post

    If you set CssClass for a control, radFormDecorator skip it from rendering process.

    ie

    <asp:Button ID="LoginButton" runat="server" CssClass="pippo" />
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017