/// <summary>
        /// Load hierarchy data into the treeview
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public override void OnLoad(IRequestHandler sender, AggregatePanelPageEventArgs e)
        {
            base.OnLoad(sender, e);

            string hierarchyType = authenticationContext.TempVariables["HierarchyType"] as string;
            IEnumerable<HierarchyDataObject> hierarchyDataObjects = hierarchyApi.GetAllHierarchyData(hierarchyType);

            List<TreeNode> treeNodes = new List<TreeNode>();
            foreach (HierarchyDataObject hierarchyDataObject in hierarchyDataObjects.Where(d => !d.ParentHierarchyDataId.HasValue))
            {
                TreeNode rootTreeNode = new TreeNode { Text = hierarchyDataObject.Name, Value = hierarchyDataObject.HierarchyDataId.ToString() };
                treeNodes.Add(rootTreeNode);
                SetupChildTreeNodes(rootTreeNode, hierarchyDataObject.HierarchyDataId, hierarchyDataObjects);
            }

            this.TreeViewHierarchyData.DataSource = treeNodes;
            this.TreeViewHierarchyData.DataBind();
        }
 /// <summary>
 /// The method will be invoked when the detail panel is prerendering.
 /// </summary>
 /// <param name="sender">The sender which invokes the callback. It's a web page in web application.</param>
 /// <param name="e">Callback event argument</param>
 public virtual void OnPreRender(IRequestHandler sender, AggregatePanelPageEventArgs e)
 {
 }
        /// <summary>
        /// When User call Save method in IAggregatePanelPage,
        /// This method will be invoked, and help user do the pre-required conditions, setup parameters
        /// </summary>
        /// <param name="commandArgument"></param>
        /// <param name="entityIdEnumerable"></param>
        public void Save(string commandArgument, IEnumerable<string> entityIdEnumerable)
        {
            setupArgs = new SetupApplicationContextVariablesEventArgs();
            aggregatePanelPageArgs = new AggregatePanelPageEventArgs("Save", entityIdEnumerable);
            sender = new RequestHandlerMock();

            IAggregatePanelPage actualPanel = actual as IAggregatePanelPage;

            actualPanel.SetupContextTempVariables(sender, setupArgs);
            actualPanel.OnInit(sender, aggregatePanelPageArgs);
            actualPanel.OnLoad(sender, aggregatePanelPageArgs);

            actualPanel.Save(commandArgument, entityIdEnumerable);
        }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public void OnLoad(IRequestHandler sender, AggregatePanelPageEventArgs e)
 {
 }
 /// <summary>
 /// Set MetadataTypeId to the form.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 public override void OnLoad(IRequestHandler sender, AggregatePanelPageEventArgs e)
 {
     base.OnLoad(sender, e);
     this.ExtensionDataFormPreview.CreateDataInputForm((Guid)applicationContext.TempVariables["MetadataDataTypeId"]);
 }