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

Change row background color for unselected items only

1 Answer 168 Views
Grid
This is a migrated thread and some comments may be shown as answers.
George
Top achievements
Rank 1
George asked on 08 May 2013, 10:44 PM
I know I can subscribe to the ItemDataBound event for the grid to change a grid row background color. What I need to figure out is how to ignore this background color when the grid row is selected. I want to maintain the skins background color on row selection. The tough part is that I don't know what this color is because I allow the user to switch between multiple skins.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 May 2013, 10:52 AM
Hi.

Please check the following code snippet I tried to remove selected row color for a RadGrid with skin.

ASPX:
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" GridLines="None" Skin="Vista">
                <ClientSettings EnableRowHoverStyle="false">
                    <Selecting AllowRowSelect="true" />
                </ClientSettings>
                <SelectedItemStyle CssClass="selectedrow" />
                ....
</telerik:RadGrid>

CSS:
<style type="text/css">
        .selectedrow
        {
            background: None !important;
            height: 22px;
            border: solid 1px white;
            border-top: solid 1px white;
            border-bottom: solid 1px white;
            padding-left: 4px;
        }
        .RadGrid_Vista .rgSelectedRow td
        {
            border-bottom-color: white !important;
        }
</style>

It looks as desired by you on my side.

Thanks,
Princy.
Tags
Grid
Asked by
George
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or