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

"Load on demand" example for real scenario

2 Answers 77 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Carlos Rodriguez
Top achievements
Rank 1
Carlos Rodriguez asked on 08 Jun 2016, 10:28 PM

Hello Telerik team!
I use the example for load on demand my orgchart, but, not sure how work, because in the example, data is load one time, but i need get data from database and create new nodes from the node selected.

I tried to create nodes but did not succeed.
Annex example.

 

Thank you vey much.

Atte.:Charly.

2 Answers, 1 is accepted

Sort by
0
Carlos Rodriguez
Top achievements
Rank 1
answered on 10 Jun 2016, 04:20 PM

Hello!

I'll restate my question:

I have this code to create new nodes when i click on drilldown button, but, not show the new nodes.

What do I lack? what am I doing wrong?

Protected Sub RadOrgChart1_DrillDown(ByVal sender As Object, ByVal e As Telerik.Web.UI.OrgChartDrillDownEventArguments) Handles RadOrgChart1.DrillDown

        Dim node = TryCast(e.SourceNode, OrgChartNode)
        If e.SourceNode.Nodes.Count > 0 Then
            e.SourceNode.Nodes.RemoveRange(0, e.SourceNode.Nodes.Count - 1)
        End If
        'get employee from database
        Dim ct As DataTable = clsOrgChart_2.orgChart_getUsers(e.SourceNode.ID).Tables(0)
        'add employees into node.
        For Each itemRow As DataRow In ct.Rows
            Dim nNode As New Telerik.Web.UI.OrgChartNode
            nNode.DataItem = itemRow
            node.Nodes.Add(nNode)
        Next
    End Sub

 

 

Thank you! :)

0
Veselin Tsvetanov
Telerik team
answered on 13 Jun 2016, 12:25 PM
Hi Carlos,

May I ask you to give as a bit more details of your implementation. What is you RadOrgChart markup declaration and how do you initially load the root nodes?

Regards,
Veselin Tsvetanov
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
OrgChart
Asked by
Carlos Rodriguez
Top achievements
Rank 1
Answers by
Carlos Rodriguez
Top achievements
Rank 1
Veselin Tsvetanov
Telerik team
Share this question
or