How to Change the back ground color of the sapn tag inside RadFormDecorator when Insert or Edit mode of grid .

3 posts, 0 answers
  1. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 15 May 2013 Link to this post

     <telerik:GridTemplateColumn UniqueName="BankType" AllowFiltering="false" EditFormHeaderTextFormat=" ">
                            <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="Fieldset"
                                Skin="Outlook" />
                            <div style="height: 150px; width: 142px; float: left; margin-left: -20px; margin-bottom: 20px;
                                border: rgb(102,102,102) solid 1px; border-radius: 8px; padding: 0px 0px 0px 5px;
                                font-family: Bold; font-size: 12px; position: relative; bottom: 100px; top: 10px;
                                left: 20px;">
                                <span style="font-weight: normal; font-family: Verdana; background-color: rgb(215,230,255);
                                    font-weight: normal; margin-top: 4px; left: 10px; position: relative; top: -10px;">
                                    &nbsp;Bank Type</span>
                                <telerik:RadGrid ID="RgList1" runat="server" AutoGenerateColumns="false" ShowHeader="false"  CssClass="RgListPosition1" >
                                    <MasterTableView AutoGenerateColumns="false">
                                            <telerik:GridTemplateColumn HeaderText="BankTypeName">
                                                    <%# Eval("BankTypeName")%>
                                            <telerik:GridTemplateColumn UniqueName="chkBankList1" HeaderText="Select" >
                                                    <asp:CheckBox ID="chkBankTypeName" runat="server" />
                                    <ClientSettings EnableRowHoverStyle="false"></ClientSettings>

    The above code inside another grid view,The outer (or) Parent grid Insert ,I am  want to set the back ground color of   a "Span  tag"  inside Rad Form Decorator .
    1. When Insert mode  of the Parent grid i want,set some "red" .
    2. when  grid edit mode i want set color of span tag background color is "white".

    any one help me plz.

  2. Venelin
    Venelin avatar
    352 posts

    Posted 20 May 2013 Link to this post

    Hello Sairam,

    One possible approach is the following:

    Replace the span with asp label:


    <asp:Label runat="server" Text="Bank Type Name" CssClass='<%# (Container is GridEditFormInsertItem) ? "Red" : "White" %>'></asp:Label>

    and add this css to your page styles:


    .White {
        font: normal Verdana;
        background-color: white;
    .Red {
        font: normal Verdana;
        background-color: red;

    In this manner, when your parent grid is in insert mode the css class Red is attached to the asp label. Otherwise (in edit mode) the css class White is attached to the label.

    I hope this helps.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. Telerik UI for ASP.NET Core is out
  4. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 20 May 2013 Link to this post

    Thanks ,'s Working thanks once again for telerik team support.
Back to Top