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

Change Alternate Row Background in RadGridView

8 Answers 598 Views
GridView
This is a migrated thread and some comments may be shown as answers.
RAVINDRA
Top achievements
Rank 1
RAVINDRA asked on 05 May 2011, 10:49 AM
Hi

I want to have different background colour each alternate row in gridview. I have use AlternateRowBackground to set the colour. But its not affecting. Please let me know if i have to use a different proeprty.

Thanks in advance
Ravindra 

8 Answers, 1 is accepted

Sort by
0
Accepted
Yordanka
Telerik team
answered on 05 May 2011, 10:56 AM
Hi RAVINDRA,

You need to set AlternationCount as well.
 
Greetings,
Yordanka
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
0
Mike Graham
Top achievements
Rank 1
answered on 20 Jun 2011, 11:12 AM
AlternationCount="2" alternates every other row...  Saves you 1 build/run cycle if you thought 1 was a good value ;)
0
Matt Matzek
Top achievements
Rank 1
answered on 08 Mar 2012, 08:11 PM
Is it possible to change the row background color for every group of N rows? For instance, if N=3, then the first three rows are gray, then the next 3 are white, than the following 3 are gray again, etc. I realize I can achieve this in code behind via the RowLoaded event, but I was wondering if that is doable via xaml only.

Thanks!
0
Vlad
Telerik team
answered on 09 Mar 2012, 07:34 AM
Hi,

 Have you tried to specify desired alteration count? 

Kind regards,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Matt Matzek
Top achievements
Rank 1
answered on 10 Mar 2012, 01:42 AM
Yes, but that does not quite achieve what I want. As I mentioned in my previous post, I want the alternate background color to apply to the next N rows. Some thing like this:

If N=3, then

Row 1 -- Bkgd: blue
Row 2 -- Bkgd: blue
Row 3 -- Bkgd: blue
Row 4 -- Bkgd: red
Row 5 -- Bkgd: red
Row 6 -- Bkgd: red
Row 7 -- Bkgd: blue
Row 8 -- Bkgd: blue
Row 9 -- Bkgd: blue
...

Do you get the idea?
0
Vlad
Telerik team
answered on 12 Mar 2012, 08:20 AM
Hi,

In this case you should use RowStyleSelector to define your condition. More info can be found on our demos. 

Regards,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Tyler
Top achievements
Rank 1
answered on 03 Oct 2013, 02:28 PM
"You need to set AlternationCount as well."
It would be nice if setting the AlternateRowBackground would also default AlternationCount to "2" if no value was specified.
0
Dimitrina
Telerik team
answered on 04 Oct 2013, 08:46 AM
Hi,

Thank you for sharing your feedback.
Currently, such an option is not planned. 

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
RAVINDRA
Top achievements
Rank 1
Answers by
Yordanka
Telerik team
Mike Graham
Top achievements
Rank 1
Matt Matzek
Top achievements
Rank 1
Vlad
Telerik team
Tyler
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or