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

Implementing RadOrgChart concerns

3 Answers 71 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mira
Top achievements
Rank 1
Mira asked on 09 Apr 2014, 10:05 AM
We are currently researching the possibility to use the RadOrgChart to display the organization chart of our company, however i didn't find any functionality that we can use to display the Replacement of an employee, the assistant of the employee, and if we can use the chart to display several Roots. for example by head of departments.


Thank you,
Mira

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 Apr 2014, 10:42 AM
Hi Mira,

I guess that you want to bind RadOrgChart with your database value. Please have a look into the sample code snippet which works fine at my end. 

ASPX:
<telerik:RadOrgChart ID="RadOrgChart1" runat="server">
</telerik:RadOrgChart>

C#:
protected void Page_Load(object sender, EventArgs e)
{
    String connstring = WebConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
    SqlConnection conn = new SqlConnection(connstring);
    SqlDataAdapter adapter = new SqlDataAdapter();
    adapter.SelectCommand = new SqlCommand("SELECT * from Employees ", conn);
    DataTable data = new DataTable();
    conn.Open();
    try
    {
        adapter.Fill(data);
    }
    finally
    {
        conn.Close();
    }
    RadOrgChart1.DataSource = data;
    RadOrgChart1.DataFieldID = "EmployeeID";
    RadOrgChart1.DataFieldParentID = "ReportsTo";
    RadOrgChart1.DataTextField = "FirstName";
    RadOrgChart1.DataBind();
}

Please elaborate your requirement if it doesn't help.
Thanks,
Princy.
0
Mira
Top achievements
Rank 1
answered on 09 Apr 2014, 11:49 AM
Thanks for your reply Princy.

Your sample code snippet works fine on my end too.

But we have a field in the database that saves the replacement of the employee and a flag that states that this employee IsAssistant to the parent. The requirement is to display the assistant and replacement as a different node in the tree or maybe display the data in the node, is there any way to display this data in the orgchart?




  







0
Accepted
Plamen
Telerik team
answered on 10 Apr 2014, 07:23 AM
Hi Mira,

Unfortunately in the current version RadOrgChart does not support assistant and replacement. One possible workaround may be to use Templates and add some additional custom icon inside the template to show some assistant or replacement.

As for your second question by design RadOrgChart does not support multiple root items and multiple parents  because it is designed to illustrate a strongly hierarchical relationship. A possible workaround for this case is to have one general parent Node above the desired roots which will generalize them.

Hope this information 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.

 
Tags
General Discussions
Asked by
Mira
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Mira
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or