Show Upto Three Levels of nodes

4 posts, 0 answers
  1. Mohammed
    Mohammed avatar
    12 posts
    Member since:
    Dec 2013

    Posted 23 Sep 2014 Link to this post

    Hello,
    I'm developing a online application with 'radOrgChart'. I have loaded the data to this radOrgChart from linqDataSource. On clicking any of the node, i need to re-display the radOrgChart as the clicked node as parent as in drill-down method. I have tested this drill-down method. But, i'm looking for different method. Instead of drill-down, i need a to click any node or a buttton inside the radOrgChart node to view. Then, while loading the page it shows all the nodes, instead of that, i need to display the parent and its child's only. Others needed to be collapsed. I check all the examples provided by telerik. It collapse using code-behind or in html setting attribute called colapsed="true" in radOrgChart. Here, i will submit my code and the screen shots. OrgChart-1 is the page when it loads before. And, OrgChart-2 is the page what i needs to be shown on page load.

    <head runat="server">
        <title></title>
        <style type="text/css">
            .orgChartDiv {
                background-color: #e4e4e4;
                height: 100%;
                width: 100%;
                overflow-y: auto;
                float: left;
                position: relative;
            }
        </style>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
     
            <div class="orgChartDiv">
                <telerik:RadOrgChart ID="employeeOrgChart" runat="server" Skin="Default" EnableCollapsing="true" Width="100%"
                    DataSourceID="LinqDataSource_Employee" DataTextField="FirstName" DataFieldID="EmployeeID" DataFieldParentID="ReportsTo"
                    EnableGroupCollapsing="true" >
                </telerik:RadOrgChart>
            </div>
        </div>
        </form>
        <asp:LinqDataSource runat="server" ID="LinqDataSource_Employee"
            ContextTypeName="RadOrgChart.RealDataDataContext" TableName="Employees" />
    </body>


    With Regards,
    Mohammed Rafsanjany
  2. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 26 Sep 2014 Link to this post

    Hi Mohammed ,

    You can use the NodeDataBound event and set the node expanded property according to your scenario as for example in the code below:
    protected void RadOrgChart1_NodeDataBound(object sender, OrgChartNodeDataBoundEventArguments e)
       {
           e.Node.Collapsed = true;
       }

    Hope this will help you solve the issue.

    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. Mohammed
    Mohammed avatar
    12 posts
    Member since:
    Dec 2013

    Posted 01 Oct 2014 in reply to Plamen Link to this post

    Hi Plamen,
    Thank you for your support.
    I tried the idea you have given. But it collapse all nodes.
    I need to show the first node (parent node) and it childrens only. Those children coming under second should be collapsed.


    And,
    Can i get drill-down click event code-behind.

    With Regards,
    Mohammed Rafsanjany
  5. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 01 Oct 2014 Link to this post

    Hello Mohammed,

    You can check the level of the node and not collapse it in case you don't want it to. 

    As for the second questions you can use the onDrillDown event of the RadOrgChart.

    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.

     
Back to Top