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

[Solved] Hierarchy grid

2 Answers 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jeroen Eikmans
Top achievements
Rank 1
Jeroen Eikmans asked on 11 Sep 2009, 09:00 AM
Hello,

In my web-app I have a page with an hierarchy grid.
I would like to give the text in non-expanded rows a different color (light gray) than in expanded rows (which are black)

Is it possible to achieve this in RadGrid?

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 11 Sep 2009, 09:44 AM
Hello Roel Martens,

You can try out the following code to set a different color to the expanded rows:
c#:
protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            if (item.Expanded) 
            { 
                item.ForeColor = System.Drawing.Color.Gray;                
            } 
            else  
            { 
                item.ForeColor = System.Drawing.Color.Empty; 
                //item.ForeColor = System.Drawing.Color.Black; 
            }             
        } 
   } 

Thanks
Princy.
0
Jeroen Eikmans
Top achievements
Rank 1
answered on 11 Sep 2009, 10:35 AM
Thanks! That works perfectly!!
Tags
Grid
Asked by
Jeroen Eikmans
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jeroen Eikmans
Top achievements
Rank 1
Share this question
or