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

[Solved] Highlight parent row when it is expanded while Making a Grid Row Selected at All Times option is enabled.

1 Answer 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
gc_0620
Top achievements
Rank 1
gc_0620 asked on 28 May 2013, 07:01 PM
Folks,

Using RadControls for ASP.NET AJAX Q1 2013 SP2 with VS 2010. I am using below link as prototype.
 

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/threelevel/defaultcs.aspx


Also my grid has making a Grid Row Selected at All Times (similar to WinForms grids) is enabled as described by below link.


http://www.telerik.com/help/aspnet-ajax/grid-selected-row-at-all-times.html


My question is it possible to highlight the parent row if it is expanded(Attached)? In attached file 1st row is highlighted, not the expanded row. I do want a grid row be selected all times also want highlight the parent row when it is expanded. That is my intention.

Any help is appreciated.
Sincerely

gc_0620

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 May 2013, 07:35 AM
Hello,

Please try the following code.

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
{
 
    if (item.Expanded) //checking if the row is expanded
    {
        item.BackColor = Color.Red;
                
    }      
}
}

Thanks,
Princy
Tags
Grid
Asked by
gc_0620
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or