Change Alternate Row Background in RadGridView

9 posts, 1 answers
  1. RAVINDRA
    RAVINDRA avatar
    47 posts
    Member since:
    Dec 2010

    Posted 05 May 2011 Link to this post

    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 
  2. Answer
    Yordanka
    Admin
    Yordanka avatar
    634 posts

    Posted 05 May 2011 Link to this post

    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
  3. DevCraft banner
  4. Mike Graham
    Mike Graham avatar
    29 posts
    Member since:
    May 2010

    Posted 20 Jun 2011 Link to this post

    AlternationCount="2" alternates every other row...  Saves you 1 build/run cycle if you thought 1 was a good value ;)
  5. Matt Matzek
    Matt Matzek avatar
    2 posts
    Member since:
    Mar 2010

    Posted 08 Mar 2012 Link to this post

    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!
  6. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 09 Mar 2012 Link to this post

    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 >>
  7. Matt Matzek
    Matt Matzek avatar
    2 posts
    Member since:
    Mar 2010

    Posted 09 Mar 2012 Link to this post

    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?
  8. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 12 Mar 2012 Link to this post

    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 >>
  9. Tyler
    Tyler avatar
    15 posts
    Member since:
    Dec 2010

    Posted 03 Oct 2013 Link to this post

    "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.
  10. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 04 Oct 2013 Link to this post

    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 >>
Back to Top
DevCraft banner