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

How to Bind Data From Sharepoint list to RadOrgChart?

1 Answer 163 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
D.SRINIVASA
Top achievements
Rank 2
D.SRINIVASA asked on 10 Jan 2012, 02:34 PM
hi all,
i am D.Srnivasa,
                  in my project i have a RadOrgChart to display a employees profiles from SharePoint List. in my sharepoint list the following are the columns to display in RadOrgChart displayed in attached file.(list.jpg)
the following is the code to display a nodes from sharepoint list to RadOrgChart

SPSite mySite = SPContext.Current.Site;
            SPWeb web = mySite.OpenWeb();
            SPList lststudent = web.Lists["Registration|Form"];
            var students  = from SPListItem student in lststudent.Items
                           where student["Reference ID"].ToString() == RadTextBox1.Text || student["EID"].ToString() == RadTextBox1.Text
                           select new
                           {
                               FullName = student["Reference Name"].ToString(),
                               ReportsTo = student["Reference ID"].ToString(),
                               EmployeeID = student["EID"].ToString()
                           };
            
            RadOrgChart1.DataSource = students;
            RadOrgChart1.DataBind();

 and my RadOrgChart Properties are :
<telerik:RadOrgChart runat="server" ID="RadOrgChart1"  DataFieldID="EmployeeID" DataFieldParentID="ReportsTo" DataTextField="FullName"></telerik:RadOrgChart>
but it doesn't display the data from the SharePoint list.
Please Help me how can i bind the the in the following picture(Display.png)

thanks
D.Srinivasa.


          

1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 16 Jan 2012, 02:09 PM
Hello,

Please try setting the DataFieldID, DataFieldParentID and DataTextField properties - as is described in this help article.

Regards,
Kalina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
ComboBox
Asked by
D.SRINIVASA
Top achievements
Rank 2
Answers by
Kalina
Telerik team
Share this question
or