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

Parent Item color display when click expand\collapse

0 Answers 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chanderler
Top achievements
Rank 1
Chanderler asked on 27 Dec 2010, 09:25 AM
Hi All,
We encounter one issue when we use RadGrid, after setting up Master\Child data, we set item background\font color accord to the item value. it works fine when loaded first time(just as scenario 1 of attached files). but when we click 'Expand\Collapse', all parent\child's color dispeared. we use below code to set color
private void HandleColorAppearance(GridItemEventArgs e)
{
                    if (bgColor != null)
                    {
                        e.Item.BackColor = System.Drawing.Color.FromName(bgColor);
                    }
                    if (fontColor != null)
                    {
                        e.Item.ForeColor = System.Drawing.Color.FromName(fontColor);
                    }
}

I make some investigation, seem that the ViewState of RadGrid doesn't store the color information, so when we click expand\collapse, those color missed.
I try to make the ViewState property to false. it works fine, but I think it's not the good solution, could you please give another way to solve this issue?

Thanks for your feedback!

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Chanderler
Top achievements
Rank 1
Share this question
or