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

Alternate Row Color

1 Answer 133 Views
GridView
This is a migrated thread and some comments may be shown as answers.
DP
Top achievements
Rank 1
DP asked on 12 Aug 2008, 04:27 AM
I am using Q2 2008. I have set EnableAlternatingRowColor to True.

I have two questions

    1. Where do you set the color for the alternate row.

    2. If you click on the column header to sort by that column, the alternate row color goes haywire, suddenly consecutive rows are colored. What is the fix?

Regards ... DP

1 Answer, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 12 Aug 2008, 02:42 PM
Hello DP,

Thank you for writing.

You could set the alternating color by using AlternatingRowColor property of GridTableElement:
this.radGridView1.EnableAlternatingRowColor = true
(this.radGridView1.GridElement as GridTableElement).AlternatingRowColor = Color.LightGreen; 

If you want to set the alternating color for child views you have to use ChildTableElement:
void radGridView1_ViewRowFormatting(object sender, RowFormattingEventArgs e) 
    if (e.RowElement is GridDetailViewRowElement) 
    { 
        (e.RowElement as GridDetailViewRowElement).ContentCell.ChildTableElement.AlternatingRowColor = Color.Red; 
    } 

I did not manage to reproduce the sorting issue. Please, create a new support ticket and send me a small example project that demonstrates the issue. It will help me to understand and investigate your case and provide you with further assistance.

I am looking forward to your reply

Greetings,
Martin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
GridView
Asked by
DP
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or