Exemplo n.º 1
0
 //private bool OneOfChildsIsChecked(TreeListNode node)
 //{
 //    bool result = false;
 //    foreach (TreeListNode item in node.Nodes)
 //    {
 //        if (item.CheckState == CheckState.Checked)
 //        {
 //            result = true;
 //        }
 //    }
 //    return result;
 //}
 private void treeListProductionStages_BeforeCheckNode(object sender, DevExpress.XtraTreeList.CheckNodeEventArgs e)
 {
     //TreeListNode node = e.Node;
     //if (node.Checked)
     //{
     //    node.UncheckAll();
     //}
     //else
     //{
     //    node.CheckAll();
     //}
     //while (node.ParentNode != null)
     //{
     //    node = node.ParentNode;
     //    bool oneOfChildIsChecked = OneOfChildsIsChecked(node);
     //    if (oneOfChildIsChecked)
     //    {
     //        node.CheckState = CheckState.Checked;
     //    }
     //    else
     //    {
     //        node.CheckState = CheckState.Unchecked;
     //    }
     //}
 }
Exemplo n.º 2
0
        private void treeListProductionStages_BeforeCheckNode(object sender, DevExpress.XtraTreeList.CheckNodeEventArgs e)
        {
            TreeListNode node = e.Node;

            if (node.Checked)
            {
                node.UncheckAll();
            }
            else
            {
                node.CheckAll();
            }
            while (node.ParentNode != null)
            {
                node = node.ParentNode;
                bool oneOfChildIsChecked = OneOfChildsIsChecked(node);
                if (oneOfChildIsChecked)
                {
                    node.CheckState = CheckState.Checked;
                }
                else
                {
                    node.CheckState = CheckState.Unchecked;
                }
            }
        }
        void tree_BeforeCheckNode(object sender, DevExpress.XtraTreeList.CheckNodeEventArgs e)
        {
            e.CanCheck = AllowCheck;


            e.State = (e.PrevState == CheckState.Checked ? CheckState.Unchecked : CheckState.Checked);
        }
Exemplo n.º 4
0
 private void TreeListBeforeCheckNode(object sender, DevExpress.XtraTreeList.CheckNodeEventArgs e)
 {
     if (e.Node.GetValue(0).GetType().Equals(typeof(ReturnObj)))
     {
         e.CanCheck = ((ReturnObj)e.Node.GetValue(0)).CanCheck;
     }
     e.State = (e.PrevState == CheckState.Checked ? CheckState.Unchecked : CheckState.Checked);
 }
Exemplo n.º 5
0
 private void treeList1_BeforeCheckNode(object sender, DevExpress.XtraTreeList.CheckNodeEventArgs e)
 {
     if (e.PrevState == CheckState.Checked)
     {
         e.State = CheckState.Unchecked;
     }
     else
     {
         e.State = CheckState.Checked;
     }
 }
Exemplo n.º 6
0
 private void tlBid_BeforeCheckNode(object sender, DevExpress.XtraTreeList.CheckNodeEventArgs e)
 {
     //if (e.PrevState == CheckState.Unchecked)
     //{
     //    if (e.Node.HasChildren)//如果存在子节点,则不可以选中
     //    {
     //        e.Node.CheckState = CheckState.Unchecked;
     //        e.CanCheck = false;
     //        return;
     //    }
     //}
 }
Exemplo n.º 7
0
 private void trlQuyenChuaCap_BeforeCheckNode(object sender, DevExpress.XtraTreeList.CheckNodeEventArgs e)
 {
     e.State = (e.PrevState == CheckState.Checked ? CheckState.Unchecked : CheckState.Checked);
 }
Exemplo n.º 8
0
 private void treeList1_BeforeCheckNode(object sender, DevExpress.XtraTreeList.CheckNodeEventArgs e)
 {
 }
Exemplo n.º 9
0
 private void m_TreeList_BeforeCheckNode(object sender, DevExpress.XtraTreeList.CheckNodeEventArgs e)
 {
     e.State = e.PrevState == CheckState.Checked ? CheckState.Unchecked : CheckState.Checked;
 }