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

Reset Drill Down / Open to 2nd level

2 Answers 84 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Kevin Dugan Jr
Top achievements
Rank 1
Kevin Dugan Jr asked on 02 Feb 2016, 02:10 PM

Question 1: How can we reset the drill down level from the code-behind? 

Question 2: How can always open to 2nd level (or perhaps 3rd level) from the code-behind? 

2 Answers, 1 is accepted

Sort by
0
Kevin Dugan Jr
Top achievements
Rank 1
answered on 03 Feb 2016, 02:38 PM

Question 2: Answer.

         protected void RadOrgChart1_NodeDataBound(object sender, Telerik.Web.UI.OrgChartNodeDataBoundEventArguments e)
        {
            if (Helper.Integer_Null(e.Node.Level) > 1)
            {
                e.Node.Collapsed = true;
            }
        }

 

 

The Helper class you see ensures I do not have any NULL's, but the logic is the same. 

0
Plamen
Telerik team
answered on 04 Feb 2016, 11:24 AM
Hello,

Thank you for getting back to us.

1) Unfortunately in the current version there is not there is no direct server API to set the drillDown node but you can set it from the server to a hidden field value and perform it from there on load as for example it is done in the the code below:
Sys.Application.add_load(function () {
                          var radOrgChart = $find("<%=RadOrgChart1.ClientID%>");
                          var $ = $telerik.$;
                          var fieldValue = $("#HiddenField1").val();
 
                          if (fieldValue) {                               
                              radOrgChart.drillDownOnNode(fieldValue);
                          }
                          
                      });


Hope this will help you solve the issue. If you have further questions please don't hesitate to contact us again.

Regards,
Plamen
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
OrgChart
Asked by
Kevin Dugan Jr
Top achievements
Rank 1
Answers by
Kevin Dugan Jr
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or