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

Alternating Row Style

1 Answer 204 Views
Grid
This is a migrated thread and some comments may be shown as answers.
miksh
Top achievements
Rank 1
Iron
miksh asked on 09 May 2014, 01:03 PM
Do all grid skins have alternating row style? E.g. Silk - how to enable it?

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 13 May 2014, 12:33 PM
Hello Michael,

As you have found out yourself, not every skin have a different background for alternating rows, which is a design's decision.

However, RadGrid allows you to easily customize the style for alternating items. Following is a simple example demonstrating how to set different background color for the alternating items:
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" Skin="Silk">
    <AlternatingItemStyle BackColor="#fafafa" />
</telerik:RadGrid>

The same could be achieved with CSS:
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" Skin="Metro" CssClass="CustomCSS">
</telerik:RadGrid>

And the CSS:
<style type="text/css">
    .CustomCSS .rgAltRow {
        background-color: #fafafa!important;
    }
</style>

Hope that helps.


Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
miksh
Top achievements
Rank 1
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or