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

RadOrgChart in Sharepoint 2010

1 Answer 58 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
Pradeepthi
Top achievements
Rank 1
Pradeepthi asked on 22 Feb 2013, 07:12 PM
Hi,

I am trying to create a Org Chart Webpart in Sharepoint 2010 using RadOrgchart, I am not getting errors but it doesnt display anything in teh page. I just see a bank Page. Can someone please help me with this?

Here is the code.

  protected override void CreateChildControls()
        {
            base.CreateChildControls();
        }

        protected override void OnInit(EventArgs e)
        {
            Page.Init += delegate(object sender, EventArgs e_Init)
            {
                if (ScriptManager.GetCurrent(Page) != null)
                {
                    Page.Items.Remove(typeof(ScriptManager));
                    scriptManager = new RadScriptManager();
                    scriptManager.ID = "ScriptManager";
                    this.Page.Items.Add(scriptManager.GetType(), scriptManager);
                    this.Page.Form.Controls.Add(scriptManager);
                }
            };

            CreateOrgChart();       
            base.OnInit(e);
        }


        private void CreateOrgChart()
        {
            DataTable oData = GetOrgData();
            RadOrgChart oOrgChart = new RadOrgChart();
            oOrgChart.DataSource = oData;
            oOrgChart.DataFieldID = "NetworkID";
            oOrgChart.DataFieldParentID = "ManagerID";
            oOrgChart.DataTextField = "FullName";
            oOrgChart.DataBind();
            this.Page.Items.Add(oOrgChart);
        }

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 28 Feb 2013, 01:39 PM
Hi Pradeepthi,

 
I am attaching a sample project where is shown how RadOrgChart can be used in a Web Part.

Hope this will be helpful.

Kind regards,
Plamen
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
Sharepoint Integration
Asked by
Pradeepthi
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or