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

GridView Problem

1 Answer 20 Views
GridView
This is a migrated thread and some comments may be shown as answers.
hanan
Top achievements
Rank 1
hanan asked on 29 Dec 2009, 10:37 AM
hello i have the rad gridview in my project and i need too diffrent color for rows

for example 
1 row     Blue
2 row   yello

3 row     Blue
4 row   yello

5 row     Blue
6 row   yello

and....

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 29 Dec 2009, 11:39 AM
Hi hanan,

To achieve your goal you can define RowStyle and AlternateRowStyle and set UseAlternateRowStyle="True" like this:

<Style TargetType="telerik:GridViewRow" x:Key="RowStyle">
     <Setter Property="Background" Value="Blue"/>
</Style>
<Style TargetType="telerik:GridViewRow" x:Key="AlternateRowStyle">
     <Setter Property="Background" Value="Yellow"/>
</Style>
  
.............
  
 <telerik:RadGridView Name="gridview" RowStyle="{StaticResource RowStyle}" AlternateRowStyle="{StaticResource AlternateRowStyle}" UseAlternateRowStyle="True"/>

I'm attaching a sample application for your reference.

Hope this helps.

Regards,
Anastasia
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
hanan
Top achievements
Rank 1
Answers by
Missing User
Share this question
or