I have a hierarchical RadGrid with Default skin.When I click the expand button,expanded row will be highlighted.I mean,row's background color will be changed.I've looked the classes given in this link,but I couldn't make it.How can I achieve this?
5 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 13 Dec 2011, 05:27 AM
Hello,
I suppose you want to change the background color of expanded rows. So you can try the following CSS.
CSS:
Thanks,
Princy.
I suppose you want to change the background color of expanded rows. So you can try the following CSS.
CSS:
<style type=
"text/css"
>
.RadGrid_Default .rgDetailTable
{
background
:
red
!important
;
}
</style>
Thanks,
Princy.
0

Emre
Top achievements
Rank 1
answered on 13 Dec 2011, 09:37 AM
Thanks Princy,it works for me.)
0

Peter
Top achievements
Rank 1
answered on 22 May 2014, 01:09 AM
Doesn't work for me - I've circled in green what I'd just like to highlight (just the top-level grid left-hand expander side).
0

Peter
Top achievements
Rank 1
answered on 22 May 2014, 01:32 AM
I found another solution by Princy which uses the PreRender event... strangely I couldn't get the CSS Style to work, so I had to run with a BackColor and Config Setting...
protected void rgAgreements_PreRender(object sender, EventArgs e)
{
foreach (GridDataItem item in rgAgreements.MasterTableView.Items)
{
if (item.Expanded) //checking if the row is expanded
{
item.Cells[0].BackColor = ColorTranslator.FromHtml(ConfigurationManager.AppSettings["ExpandedItemColour"]);
}
else
{
item.Cells[0].BackColor = Color.FromArgb(217, 217, 217);
}
}
}
protected void rgAgreements_PreRender(object sender, EventArgs e)
{
foreach (GridDataItem item in rgAgreements.MasterTableView.Items)
{
if (item.Expanded) //checking if the row is expanded
{
item.Cells[0].BackColor = ColorTranslator.FromHtml(ConfigurationManager.AppSettings["ExpandedItemColour"]);
}
else
{
item.Cells[0].BackColor = Color.FromArgb(217, 217, 217);
}
}
}
0
Hello Peter,
I'm glad you have managed to find a viable solution for your specific scenario.
As for the CSS approach, you can try to increase the specificity of the rule. You can check various sources over the net about CSS specificity:
http://specificity.keegan.st/
Hope this helps.
Regards,
Eyup
Telerik
I'm glad you have managed to find a viable solution for your specific scenario.
As for the CSS approach, you can try to increase the specificity of the rule. You can check various sources over the net about CSS specificity:
http://specificity.keegan.st/
Hope this helps.
Regards,
Eyup
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.