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

Changing Background Color in OnHierarchyExpanded

2 Answers 34 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Justin McMillen
Top achievements
Rank 1
Justin McMillen asked on 29 Apr 2010, 05:38 PM
Hi,
Can someone tell me how to change the background color of the RadGrid row when a user expands and the OnHierarchyExpanded Client event is fired?

Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 30 Apr 2010, 06:02 AM
Hello Justin,

You can change the background color of the RadGrid row in OnHierarchyExpanded event by using following client side code.

Java Script:

<script type=
"text/javascript"
 function HierarchyExpanded(sender, eventargs) { 
    eventargs.get_gridDataItem().get_element().style.backgroundColor = "red"
    eventargs.get_gridDataItem().get_element().style.backgroundImage = "none"
    } 
</script> 
[Also set the MasterTableView-HierarchyLoadMode as "Client"]

Regards,
Shinu.
0
Justin McMillen
Top achievements
Rank 1
answered on 05 May 2010, 03:19 PM
Hi Shinu,
  This works well.  Thank you.
Tags
Grid
Asked by
Justin McMillen
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Justin McMillen
Top achievements
Rank 1
Share this question
or