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

[Solved] alternatingItemStyle

1 Answer 202 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Patrick Stovall
Top achievements
Rank 1
Patrick Stovall asked on 22 May 2008, 12:56 PM
I have a grid that is using Office2007 skin.  I needed to have alternating colors on the rows so I set the alternatingitemstyle for the grid to the color I wanted.  Now I am having an issue in that the selected row color doesn't fill the row from top to bottom on the alternating colored rows.  The selected row color works fine for those rows that don't have a row color but on the altnernating ones, it cuts the selected row color off directly below the text in the row.

Has anyone else see this?  What is the fix?

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 22 May 2008, 04:25 PM
Hello Patrick,

Setting AlternatingItemStyle declaratively messes up the skin's selected row style, because declared styles render as inline styles and those take precendence over skin styles.

I recommend that you set custom CSS classes declaratively and use them to define styles in a stylesheet. For example:

<telerik:RadGrid 
    ID="RadGrid1" 
    runat="server" 
    Skin="Office2007"
    <SelectedItemStyle CssClass="selectedRow" /> 
    <MasterTableView> 
        <AlternatingItemStyle CssClass="altRow" /> 
    </MasterTableView> 
</telerik:RadGrid> 


CSS

 
tr.altRow 
   backgroundred ; 
 
tr.selectedRow 
   backgroundgreen ; 


Let us know if you need further advice.


Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Patrick Stovall
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or