Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
22 views
In RadOrgChart , Why is this happening ?
Pro
Top achievements
Rank 1
 asked on 14 Jul 2023
0 answers
69 views

I have a large dataset of employees.

I want to load one node initially and all other node collapsed and load other node on demand.

But this control is loading complete data on page load which is making it slow.

is there any way to rebind the org chart on expand and bind all child nodes?

 

anuj
Top achievements
Rank 1
 asked on 01 Jun 2023
1 answer
54 views

I would like to add a hyper link to the node of an Org Chart, and I tried to add like:


<telerik:RadOrgChart>
<ItemTemplate>
<div class="abc">
<a herf="abc.abc">test link</a>
But it won't work. The hyperlink is not even clickable. Can anyone tell me how to add hyperlink to OrgChart?
yuki
Top achievements
Rank 2
Iron
Iron
Iron
 updated answer on 08 May 2023
1 answer
79 views

My page logic is that I click on an 'Apply' button, then in the Apply_Click method, I do some data binding, such as: Grid1.Datasource = xxx; Grid1.DataBind(); . And the grid can show properly on the page. But when I click on other buttons on this page (for example: click the filter on the grid) to trigger a post back, the content on the grid just disappears (The datasource is stored in a session, so it's not datasource's problem). I need to add databind() to Page_Load() to prevent this from happening. But this is very weird and feels not right. Can you help me locate the real problem?

The same issue is happening bothe in Grid and OrgChart.

Doncho
Telerik team
 answered on 25 Apr 2023
1 answer
150 views

I read this , but when I copied the code into my own project and followed the documentation, this just didn't work. The node size and the group size are weird.  No matter how I tried to edit the css settings, the height of the node just wouldn't change. Can anybody help me?

And btw I also want to ask, what do  .rocItem and .rocItemContent mean? When I use my browser's inspect function, I also see a .rocItemTemplate, what is that?

Doncho
Telerik team
 answered on 25 Apr 2023
0 answers
42 views

So I have a organization chart and a button. When I click on the button, I will fill in a DataTable stored in ViewState to be the data source of the org chart. Since I'm still having the problem in another post that nobody replied yet: Databinding keeps disappearing when post back in UI for ASP.NET AJAX | Telerik Forums  So I add some handling in Page_Load to avoid the org chart from becoming blank.

My Page logic is as follows:


<Telerik:RadButton ID="btn1" OnClick="btn_click">
...
<Telerik:RadOrgChart ID="OrgChart1">



protected DataTable table1 { get { if (ViewState["table1"] != null) return (DataTable)ViewState["table1"]; else

return null; } set { ViewState["table1"] = value; } } protected DataTable table2 { get { if (ViewState["table2"] != null) return (DataTable)ViewState["table2"]; else return null; } set { ViewState["table2"] = value; } } protected void Page_Load(object sender, EventArgs e) { if (!PostBack) // do something

if (table1 != null && table2!=null) { OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "aaa"; OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "bbb"; OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataCollapsedField = "ccc"; OrgChart1.RenderedFields.NodeFields.Add(new OrgChartRenderedField() { DataField = "A" }); OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataSource = table1; OrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataFieldNodeID = "aaa"; OrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataFieldID = "ddd"; OrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataSource = table2; OrgChart1.DataBind(); } }



protected void btn_click(object sender, EventArgs e) {

               // do something to provide data for table1 and table2

                OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "aaa";
                OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "bbb";
                OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataCollapsedField = "ccc";
                OrgChart1.RenderedFields.NodeFields.Add(new OrgChartRenderedField() { DataField = "A" });
                OrgChart1.GroupEnabledBinding.NodeBindingSettings.DataSource = table1;

                OrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataFieldNodeID = "aaa";
                OrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataFieldID = "ddd";
                OrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataSource = table2;

                OrgChart1.DataBind();

}

    

And then, when the page is post back, suddenly there are duplicate group names in the org chart as you can see in the screenshot.

Can somebody help me?

yuki
Top achievements
Rank 2
Iron
Iron
Iron
 updated question on 21 Apr 2023
0 answers
31 views
Is it possible to add a radbutton to org chart nodes? I would like to add a button to org chart nodes, and when the button is clicked, something happens to the webpage. I looked through demos and didn't find anything related? Could someone tell me if this is feasible? Thanks.
yuki
Top achievements
Rank 2
Iron
Iron
Iron
 updated question on 21 Apr 2023
0 answers
49 views

Is there any way to sort nodes based on hierarchyid?

currently default sorting based on alphabetical order.

 

Thanks in advance

Hari
Top achievements
Rank 1
 asked on 28 Jan 2022
16 answers
270 views
I am using the OrgChart control to display 1100 employees.  Due to the size and structure of the company I have limited it to displaying 2 levels of employees and enabled drill down.

What I'm trying to implement now is the ability for someone to search for a particular employee and then jump to that location in the OrgChart.  Is that even possible?  If so, it certainly isn't straightforward.

Thanks,
Kyle
SMc
Top achievements
Rank 2
Iron
Veteran
Iron
 answered on 17 Dec 2020
3 answers
112 views

Hi Telerik Team,

I'm having an issue with the drill down functionality, I'm binding the data source to the org chart control on Page Load Event and I have a drill down handler when the user click on the drill down icon.

 

The data tables I'm using to bind the org chart are:

1). OrgChartStructure (Which will be defined the levels of the organization chart)

Id | ParentID|Title

1    NULL     CEO (PK)

2     1            President

3     2            VP Sales

2). Org Chart

Id| NodeID| FirstName|LastName| Title|ImgPath

1    1             John        Doe            CEO

2     2            Jane        Doe            President

3     2            James     Doe            VP Sales

 

My Code:

 

<div class="demo-container no-bg">
    <div class="search">
        <telerik:RadSearchBox RenderMode="Lightweight" runat="server"  ID="RadSearchBox1" DataTextField="FullName" DataValueField="NodeID" EnableAutoComplete="true"
            OnClientSearch="onClientSearch" Skin="Silk">
        </telerik:RadSearchBox>
        <div class="rocBreadCrumb"></div>
    </div>
    <telerik:RadOrgChart ID="rocOrgChart"
        runat="server"
        RenderMode="Lightweight"
        EnableCollapsing="true"
        EnableDrillDown="true"
        EnableGroupCollapsing="true"
        Skin="Silk"
        DataFieldID="ID" DataFieldParentID="ParentID"
        DataTextField="FullName" DataImageUrlField="ImgPath">
    </telerik:RadOrgChart>
</div>

BackCode:

 

 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not Page.IsPostBack Then
            GenerateOrgChart()
        End If
    End Sub

 

 Public Sub GenerateOrgChart()
        Try
            Dim ds_orgStructure As DataSet = sqhBI20.ReturnDataSetFromSproc("spGetOrgChartStructure")
            Dim dt_orgStucture As DataTable = ds_orgStructure.Tables(0)
            If Not dt_orgStucture Is Nothing Then
                rocOrgChart.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "ID"
                rocOrgChart.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "ParentID"
                rocOrgChart.GroupEnabledBinding.NodeBindingSettings.DataSource = ds_orgStructure
            End If


            Dim ds_OrgChart As DataSet = sqhBI20.ReturnDataSetFromSproc("SpGetOrgChart")
            Dim dt_OrgChart As DataTable = ds_OrgChart.Tables(0)
            If Not dt_OrgChart Is Nothing Then
                rocOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataFieldID = "ID"
                rocOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataFieldNodeID = "NodeID"
                rocOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataTextField = "FullName"
                rocOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataImageUrlField = "ImgPath"
                rocOrgChart.RenderedFields.ItemFields.Add(New Telerik.Web.UI.OrgChartRenderedField() With {.DataField = "NodeID"})
                rocOrgChart.GroupEnabledBinding.GroupItemBindingSettings.DataSource = ds_OrgChart
            End If
            rocOrgChart.DataBind()

            RadSearchBox1.Text = ""
            RadSearchBox1.DataSource = ds_OrgChart
            RadSearchBox1.DataBind()

        Catch ex As Exception
            Throw New Exception(ex.ToString())
        End Try
    End Sub

 

Public Sub rocOrgChart_DrillDown(sender As Object, e As Telerik.Web.UI.OrgChartDrillDownEventArguments) Handles rocOrgChart.DrillDown
    
        Dim item = New OrgChartGroupItem() With {.DataItem = "NodeID"}
        e.SourceNode.Renderer.Controls.Remove(e.SourceNode.Nodes.Renderer)
        e.SourceNode.GroupItems.Clear()
        e.SourceNode.Nodes.Clear()
        e.SourceNode.GroupItems.Add(item)

    End Sub

 

Peter Milchev
Telerik team
 answered on 16 Dec 2020
Narrow your results
Selected tags
Tags
+? more
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
horváth
Top achievements
Rank 2
Iron
Iron
Steve
Top achievements
Rank 2
Iron
Erkki
Top achievements
Rank 1
Iron
Mark
Top achievements
Rank 2
Iron
Iron
Veteran
Jakub
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?