Expand Specific level in ORG Chart

7 posts, 1 answers
  1. Alaa'
    Alaa' avatar
    20 posts
    Member since:
    Apr 2014

    Posted 07 Apr 2014 Link to this post

    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 
  2. Answer
    Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 09 Apr 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Alaa'
    Alaa' avatar
    20 posts
    Member since:
    Apr 2014

    Posted 09 Apr 2014 in reply to Plamen Link to this post

    Thank you , it's work 
  5. Alaa'
    Alaa' avatar
    20 posts
    Member since:
    Apr 2014

    Posted 10 Apr 2014 in reply to Alaa' Link to this post

    Hi again ,
    I want to ask if there away to do that in server side ? 
  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 Apr 2014 in reply to Alaa' Link to this post

    Hi Alaa,

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

    Thanks,
    Shinu.
  7. Alaa'
    Alaa' avatar
    20 posts
    Member since:
    Apr 2014

    Posted 10 Apr 2014 in reply to Shinu Link to this post

    is there a different if it a single binding not groped ?
  8. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 11 Apr 2014 in reply to Alaa' Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017