How to set color of the Row, When check Box is selected In RadGrid.

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

    Posted 14 May 2013 Link to this post

     <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 ..is inside another grid ....when user select the inner grid checked box ,I  want to set some " css class color" to the row .
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 14 May 2013 Link to this post

    Hi,

    Please try the following code snippet to change the color of the row on CheckBox CheckChanged event.

    C#:
    protected void chkBankTypeName_CheckedChanged(object sender, EventArgs e)
    {
        CheckBox chk = (CheckBox)sender;
        GridDataItem ditem = (GridDataItem)chk.NamingContainer;
        ditem.BackColor = Color.Red;
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sairam
    Sairam avatar
    56 posts
    Member since:
    May 2013

    Posted 14 May 2013 Link to this post

    Thanks Princy,but  I need solution in clients -side ,  not  at server-side.can your help in it.Unfortunately code is not working ...When user checks on check box ,I want  show  checked row color changes to "blue".  
Back to Top