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

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

2 Answers 86 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sairam
Top achievements
Rank 1
Sairam asked on 15 May 2013, 01:49 PM
 <telerik:GridTemplateColumn UniqueName="BankType" AllowFiltering="false" EditFormHeaderTextFormat=" ">
                    <EditItemTemplate>
                        <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">
                                    <Columns>
                                        <telerik:GridTemplateColumn HeaderText="BankTypeName">
                                            <ItemTemplate>
                                                <%# Eval("BankTypeName")%>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn UniqueName="chkBankList1" HeaderText="Select" >
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chkBankTypeName" runat="server" />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                    </Columns>
                                </MasterTableView>
                                <ClientSettings EnableRowHoverStyle="false"></ClientSettings>
                            </telerik:RadGrid>
                        </div>
                    </EditItemTemplate>
                </telerik:GridTemplateColumn>


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 Answers, 1 is accepted

Sort by
0
Venelin
Telerik team
answered on 20 May 2013, 09:08 AM
Hello Sairam,

One possible approach is the following:

Replace the span with asp label:

ASPX:

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

and add this css to your page styles:

CSS:

.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.

Regards,
Venelin
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.
0
Sairam
Top achievements
Rank 1
answered on 20 May 2013, 09:31 AM
Thanks , Venelin.it's Working thanks once again for telerik team support.
Tags
General Discussions
Asked by
Sairam
Top achievements
Rank 1
Answers by
Venelin
Telerik team
Sairam
Top achievements
Rank 1
Share this question
or