New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

RadOrgChart Object

RadOrgChart provides a flexible client-side API. You can easily interact with RadOrgChart in the browser using its client-side object. In addition to a variety of client-side events, the client-side object model lets you achieve complicated tasks while avoiding unnecessary post-backs.

Getting the RadOrgChart client-side object

RadOrgChart creates a client-side object with its ClientID. You can obtain the reference using the following JavaScript code:

JavaScript
	
var orgChartObject = $find("<%= RadOrgChart1.ClientID %>");
	

The following table lists the most important methods of the client-side RadOrgChart object:

NameParametersReturn TypeDescription
get_enableDragAndDropnoneBooleanReturns whether user is allowed to drag and drop nodes.
saveClientStatenonenoneSaves the client state to the client state hidden field
repaintnonenoneRefreshes the RadOrgChart UI
get_allowGroupItemDraggingnoneBooleanReturns whether user is allowed to drag and drop group items.
get_nodesnoneOrgChartNodeCollectionGets a collection with all nodes
get_nodeListElementnonenoneGets the UL element of the RadOrgChart
get_elementnonenoneGets the root DOM element of the RadOrgChart
drillDownOnNodestringnoneDrills down on the node with the specified Hierarchical index. See Example 1.
extractNodeFromDomElementDOM elementnoneGets a reference to the node by passing its DOM element to the method.
extractGroupItemFromDomElementDOM elementnoneGets a reference to the group item by passing its DOM element to the method.
get_drilledNodeHierarchicalIndexnonestringGets the Hierarchical index of the node that is drilled.

Example 1: Drill down on the node with Hierarchical index "0:1".

JavaScript
var orgChartObject = $find("<%= RadOrgChart1.ClientID %>");
var node = orgChartObject.get_nodes().getNode(0);
var level1Child1Index = node.get_nodes().getNode(1).get_hierarchicalIndex();
orgchart.drillDownOnNode(level1Child1Index);