RadOrg Chart Post Back Issues

1 posts, 0 answers
  1. Sourav
    Sourav avatar
    6 posts
    Member since:
    Apr 2014

    Posted 12 Jun 2014 Link to this post

        I am using rad Org Chart but I want some customization . I saw there Chart is binding with each and every postback. So when ever postback occurs it will call database every time. 
    can it be like this, But I am getting some error if i placed it under (!IsPostBack) :-
      protected void Page_Load(object sender, EventArgs e)
        {
      if(!IsPostBack)
           {
                Page.Header.DataBind();
                CreateTeams();
                CreateEmployees();
                DtVwEmp = (DataTable)ViewState["Emp"];
                DtVwTeam = (DataTable)ViewState["team"];
                RadOrgChart1.GroupEnabledBinding.NodeBindingSettings.DataFieldID = "TeamID";
                RadOrgChart1.GroupEnabledBinding.NodeBindingSettings.DataFieldParentID = "ReportsTo";
                RadOrgChart1.RenderedFields.NodeFields.Add(new Telerik.Web.UI.OrgChartRenderedField() { DataField = "Team" });
                RadOrgChart1.GroupEnabledBinding.NodeBindingSettings.DataSource = DtVwTeam;
                RadOrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataFieldID = "NodeId";
                RadOrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataFieldNodeID = "TeamID";
                RadOrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataTextField = "Name";
                RadOrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataImageUrlField = "ImageUrl";
                RadOrgChart1.GroupEnabledBinding.GroupItemBindingSettings.DataSource = DtVwEmp;
                RadOrgChart1.DataBind();
             }
        }






Back to Top