RadOrgChart in Sharepoint 2010

2 posts, 0 answers
  1. Pradeepthi
    Pradeepthi avatar
    1 posts
    Member since:
    Feb 2013

    Posted 22 Feb 2013 Link to this post

    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);
            }
  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 28 Feb 2013 Link to this post

    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.

Back to Top