protected void twvMenu_NodeCheck(object sender, FineUI.TreeCheckEventArgs e)
    {
        if (!e.Node.Leaf)
        {
            CheckTreeNode(e.Node.Nodes, e.Checked);
        }

        if (e.Checked)
        {
            CheckParentNode(e.Node);
        }

        #region  些代码需要和authorityGrid_RowSelect一起使用,但其效率过低
        //List<int> ids = GetCheckedNodeIDs();
        //List<int> selectedRowIndexArray = authorityGrid.SelectedRowIndexArray.ToList();
        //List<int> newSelectedRowIndexArray = new List<int>();

        //for (int i = 0; i < authorityGrid.Rows.Count; i++)
        //{
        //    if (selectedRowIndexArray.Contains(i))
        //    {
        //        int menuID = int.Parse(authorityGrid.DataKeys[i][1].ToString());
        //        if (ids.Contains(menuID))
        //        {
        //            newSelectedRowIndexArray.Add(i);
        //        }
        //    }
        //}
        //authorityGrid.SelectedRowIndexArray = newSelectedRowIndexArray.ToArray();
        #endregion
    }
Example #2
0
 protected void Tree2_NodeCheck(object sender, FineUI.TreeCheckEventArgs e)
 {
     if (e.Checked)
     {
         Tree2.CheckAllNodes(e.Node.Nodes);
     }
     else
     {
         Tree2.UncheckAllNodes(e.Node.Nodes);
     }
 }
Example #3
0
        protected void tvGlobalPermissions_NodeCheck(object sender, FineUI.TreeCheckEventArgs e)
        {
            if (e.Checked)
            {
                if (e.Node.Nodes.Count > 0)
                {
                    tvGlobalPermissions.CheckAllNodes(e.Node.Nodes);
                }

                if (e.Node.ParentNode != null)
                {
                    if (!e.Node.ParentNode.Checked)
                    {
                        Utils.NodeParentsCheck(e.Node);
                        //Tree1.CheckAllNodes(e.Node.ParentNode.ParentNode.Nodes);
                    }

                    if (e.Node.Checked == false)
                    {
                        Utils.NodeParentsUnCheck(e.Node.ParentNode);
                    }
                }
            }
            else
            {
                tvGlobalPermissions.UncheckAllNodes(e.Node.Nodes);

                if (e.Node.ParentNode == null)
                {
                    return;
                }

                if (e.Node.Checked == false)
                {
                    Utils.NodeParentsUnCheck(e.Node.ParentNode);
                }
            }
        }
Example #4
0
 /// <summary>
 /// 触发节点选中事件
 /// </summary>
 /// <param name="e">事件参数</param>
 protected virtual void OnNodeCheck(TreeCheckEventArgs e)
 {
     EventHandler<TreeCheckEventArgs> handler = Events[_nodeCheckHandlerKey] as EventHandler<TreeCheckEventArgs>;
     if (handler != null)
     {
         handler(this, e);
     }
 }
        protected void trUser_NodeCheck(object sender, TreeCheckEventArgs e)
        {
            if (e.Checked)
            {

                trUser.CheckAllNodes(e.Node.Nodes);
            }
            else
            {
                trUser.UncheckAllNodes(e.Node.Nodes);
            }
            CreateMenuOperRes();
        }