public void TreeViewManage_SelectedNodeChanged(object sender, EventArgs e)
        {
            isSelectedCategory = true;
            parrentName        = TreeViewManage.SelectedNode.Text;
            int.TryParse(TreeViewManage.SelectedNode.Value, out parentID);
            //ViewState.Add("ParentID", ParentID);

            if (ParentID > 0 && TreeViewManage.SelectedNode.ChildNodes.Count == 0)
            {
                CategoriesActions categoriesActions = new CategoriesActions();
                List <Categories> listCategories    = categoriesActions.GetCategories(parentID);

                foreach (Categories item in listCategories)
                {
                    TreeNode treeNode = new TreeNode(item.Name, item.ID.ToString());
                    TreeViewManage.SelectedNode.ChildNodes.Add(treeNode);
                }
            }

            TreeViewManage.SelectedNode.Expand();

            var args = new TreeViewManageEventArgs(TreeViewManage.SelectedNode);

            OnSelectedNodeChanged(args);
        }
 public virtual void OnSelectedNodeChanged(TreeViewManageEventArgs e)
 {
     if (SelectedNodeChanged != null)
     {
         SelectedNodeChanged(this, e);
     }
 }
 public virtual void OnSelectedNodeChanged(TreeViewManageEventArgs e)
 {
     if (SelectedNodeChanged != null)
     {
         SelectedNodeChanged(this, e);
     }
 }
        public void TreeViewManage_SelectedNodeChanged(object sender, EventArgs e)
        {
            _isSelectedCategory = true;
            _parrentName = TreeViewManage.SelectedNode.Text;
            int.TryParse(TreeViewManage.SelectedNode.Value, out _parentId);
            //ViewState.Add("ParentID", ParentID);
            
            if (ParentID > 0 && TreeViewManage.SelectedNode.ChildNodes.Count == 0)
            {
                var categoriesActions = new CategoriesActions();
                var listCategories = categoriesActions.GetCategories(_parentId);
                
                foreach (var item in listCategories)
                {
                    var treeNode = new TreeNode(item.Name, item.ID.ToString());
                    TreeViewManage.SelectedNode.ChildNodes.Add(treeNode);
                }
            }

            TreeViewManage.SelectedNode.Expand();

            var args = new TreeViewManageEventArgs(TreeViewManage.SelectedNode);
            OnSelectedNodeChanged(args);
        }