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

Expand Specific level in ORG Chart

6 Answers 188 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Alaa'
Top achievements
Rank 1
Alaa' asked on 07 Apr 2014, 11:47 AM
Hi,
in my project , i need to expand just 2 level in ORG Chart 
i try to expand a specific node but it doesn't work ! 
is their a simple way to do it ? 
thank you 

6 Answers, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 09 Apr 2014, 06:29 AM
Hi,

One way to achieve similar behavior is to manually click the expand arrow on load of the page:
function pageLoad(){
$telerik.$(".rocExpandArrow").get(0).click();
}

Hope this will be helpful.

Regards,
Plamen
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.

 
0
Alaa'
Top achievements
Rank 1
answered on 09 Apr 2014, 09:46 AM
Thank you , it's work 
0
Alaa'
Top achievements
Rank 1
answered on 10 Apr 2014, 05:23 AM
Hi again ,
I want to ask if there away to do that in server side ? 
0
Shinu
Top achievements
Rank 2
answered on 10 Apr 2014, 07:05 AM
Hi Alaa,

Please have a look into this help documentation which discuss about the Expand/Collapse the RadOrgChart from server side.

Thanks,
Shinu.
0
Alaa'
Top achievements
Rank 1
answered on 10 Apr 2014, 07:59 AM
is there a different if it a single binding not groped ?
0
Shinu
Top achievements
Rank 2
answered on 11 Apr 2014, 07:15 AM
Hi Alaa,

RadOrgChart supports Expand/Collapse of the RadOrgChart hierarchical tree. The functionality could be enabled by setting EnableCollapsing property to true. Based on the DataCollapseField Value RadOrgchart will Collapse/expand. Please have a look into the sample code snippet which works fine at my end.

ASPX:
<telerik:RadOrgChart runat="server" ID="RadOrgChart2" EnableCollapsing="true">
</telerik:RadOrgChart>
<telerik:RadButton ID="RadButton1" runat="server" Text="Expand" OnClick="RadButton1_Click">
</telerik:RadButton>

C#:
protected void Page_Load(object sender, EventArgs e)
{
    var nodes = new DataTable();
    nodes.Columns.Add("ID");
    nodes.Columns.Add("ParentID");
    nodes.Columns.Add("Collapsed");
    nodes.Rows.Add(new string[] { "1", null, "1" });
    nodes.Rows.Add(new string[] { "2", "1", "0" });
    nodes.Rows.Add(new string[] { "3", "2", "1" });
    nodes.Rows.Add(new string[] { "4", "3", "0" });
 
    RadOrgChart2.DataFieldID = "ID";
    RadOrgChart2.DataFieldParentID = "ParentID";
    RadOrgChart2.DataCollapsedField = "Collapsed";
 
    RadOrgChart2.DataSource = nodes;
    RadOrgChart2.DataBind();
}
protected void RadButton1_Click(object sender, EventArgs e)
{
    RadOrgChart2.ExpandAllNodes();
}

Thanks,
Shinu.
Tags
OrgChart
Asked by
Alaa'
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Alaa'
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or