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

Error occuring when following RadGrid SelectedRowStyle Demo

1 Answer 37 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
mc2000 asked on 02 Jun 2010, 01:57 PM
Hi: I am attempting to follow the example exactly as listed on:

I have a RadGrid with the default theme. For testing I changed it to Web20 to match the example exactly. I want to set the selected row style to have no background image but a background color of dark grey.

My markup looks like:

 <telerik:RadMenu runat="server" ID="NotificationRadMenu" Skin="Sitefinity"  EnableShadows="true" DefaultGroupSettings-OffsetX="-210">  
                <telerik:RadMenuItem Visible="false" Value="label" Enabled="false"></telerik:RadMenuItem> 
                <telerik:RadMenuItem Value="TemplateHeader">  
                        <asp:Label ID='AlertNoticeNumber' CssClass='AlertNoticeNumber' runat="server" Text="Label" Visible="false"></asp:Label> 
                        <telerik:RadMenuItem CssClass="AlertMenuItem" Value="TemplateColumn">  
                            <div class="AlertMenuItemContainer">  
                            <Telerik:RadGrid RegisterWithScriptManager="true" ID="StudentCheckListRadGrid" AutoGenerateColumns="false" runat="server" AllowSorting="true" 
                              AllowPaging="false" ShowHeader="false" PageSize="10" Width="100%" BorderWidth="0" ItemStyle-BackColor="#E8E8E8" AlternatingItemStyle-BackColor="White" 
                              ClientSettings-EnableRowHoverStyle="false" OnSelectedIndexChanged="StudentCheckListRadGrid_SelectedIndexChanged" 
                              ClientSettings-EnablePostBackOnRowClick="true" ClientSettings-Selecting-AllowRowSelect="true" Skin="Web20">   
                                <MasterTableView AllowMultiColumnSorting="true" AutoGenerateColumns="false" ForeColor="#4B4B4B" Font-Names="Tahoma,Arial,Verdana" Font-Size="11px">  
                                    <Telerik:GridBoundColumn DataField="TaskNameCheckList" HeaderText="TaskNameCheckList"></Telerik:GridBoundColumn> 
                                    <Telerik:GridBoundColumn Visible="false" DataField="TaskAssociatedUserControlCheckList" HeaderText="TaskAssociatedUserControlCheckList"></Telerik:GridBoundColumn> 

I then created a Css entry

tr.SelectedRow_Web20 td  
     background-color: red;  
     background-image: none;  
     padding-right: 17px;  

The row style DOES NOT CHANGE when selected. I also noticed that when I use the <SelectedItemStyle BackColor="red" /> it works okay, but when I tried <SelectedItemStyle CssClass="RedClass" /> it does not import the styles. This method would work okay if it would allow me to remove the background image. Thanks!

1 Answer, 1 is accepted

Sort by
Telerik team
answered on 07 Jun 2010, 11:22 AM
Hello Mark,

Please use the following code to achieve the desired look:
<style type="text/css">
    .RadGrid_Web20 .rgSelectedRow
        background: red !important;

I hope this helps.

the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question