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

Get Expand/Collapse Column in Child Grid

1 Answer 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Frank
Top achievements
Rank 1
Frank asked on 25 Mar 2010, 08:09 PM
I have a master grid that opens to show  rows in a child grid. The master grid has alternating colors for rows. I want the child rows to all have the same color as their parent row. This I have accomplished, but the first  column (contains the expand/collapse button in parent row) is not colored appropriatly.

How do I get access to that column's cell to change it's background color?

I have attached two image files...one with parent collapsed and one with parent expanded.

Thank you,
Frank Prevatt

1 Answer, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 31 Mar 2010, 07:34 AM
Hello Frank,

You can hook to RadGrid's ItemCreated event, get reference to the GridNestedViewItem and set the appropriate cell's background color. Similar to the following:

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridNestedViewItem)
    {
        (e.Item as GridNestedViewItem).Cells[0].BackColor = Color.Red;
    }
}


Regards,
Rosen
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.
Tags
Grid
Asked by
Frank
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Share this question
or