DevExpress XtraTreeList的核取方塊 禁用

衣舞晨風發表於2015-10-23
#region 樹treeList_CustomDrawNodeCheckBox
        private void treeList_CustomDrawNodeCheckBox(object sender, CustomDrawNodeCheckBoxEventArgs e)
        {
            if (e != null && e.Node != null && e.Node.Tag != null)
            {
                if (e.Node.Tag.ToString() == "-1")
                {
                    e.ObjectArgs.State = DevExpress.Utils.Drawing.ObjectState.Disabled;
                }
            }
        }
        #endregion

        private void treeList_BeforeCheckNode(object sender, DevExpress.XtraTreeList.CheckNodeEventArgs e)
        {
            if (e.Node.Tag.ToString() == "-1")
            {
                e.State = CheckState.Unchecked;
            }
        }


作者:jiankunking 出處:http://blog.csdn.net/jiankunking


相關文章