duheng
2024-08-23 5d25f26f883f547aff8a8246c1127d63d851dafe
WinFrmUI/Yw.WinFrmUI.Core/00-core/TreeListExtensions.cs
@@ -1,7 +1,7 @@
namespace Yw.WinFrmUI
{
    /// <summary>
    ///
    ///
    /// </summary>
    public static class TreeListExtensions
    {
@@ -48,13 +48,13 @@
        {
            InitialDefaultSettings(rhs, height);
            rhs.CheckBoxFieldName = checkBoxFieldName;//多选框绑定列名
            rhs.OptionsBehavior.AllowRecursiveNodeChecking = true;//获取或设置父节点时是否自动检查/取消检查子节点
            rhs.OptionsBehavior.AllowRecursiveNodeChecking = true;//获取或设置父节点时是否自动检查/取消检查子节点
            rhs.OptionsView.CheckBoxStyle = DevExpress.XtraTreeList.DefaultNodeCheckBoxStyle.Check;//设置勾选框样式
        }
        /// <summary>
        /// 初始化可编辑视图
        /// </summary>
        /// </summary>
        public static void InitialBindingNormalEditView(this TreeList rhs, int height = 30)
        {
            rhs.OptionsSelection.EnableAppearanceFocusedCell = false;
@@ -84,7 +84,6 @@
            rhs.Appearance.HeaderPanel.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            rhs.Appearance.Row.TextOptions.HAlignment = DevExpress.Utils.HorzAlignment.Center;
            rhs.RowHeight = height;
        }
        /// <summary>
@@ -97,10 +96,9 @@
        {
            InitialDefaultSettings(rhs, height);
            rhs.CheckBoxFieldName = checkBoxFieldName;//多选框绑定列名
            rhs.OptionsBehavior.AllowRecursiveNodeChecking = true;//获取或设置父节点时是否自动检查/取消检查子节点
            rhs.OptionsBehavior.AllowRecursiveNodeChecking = true;//获取或设置父节点时是否自动检查/取消检查子节点
            rhs.OptionsView.CheckBoxStyle = DevExpress.XtraTreeList.DefaultNodeCheckBoxStyle.Check;//设置勾选框样式
        }
        /// <summary>
        /// 渐变色
@@ -145,7 +143,7 @@
        /// <summary>
        /// 设置拖拽状态下的普通视图
        /// </summary>
        /// </summary>
        public static void SetDragViewModels<t>(this TreeList rhs) where t : class
        {
            rhs.DragDrop += (sender, e) =>
@@ -172,13 +170,5 @@
                foreach (TreeListNode n in node.Nodes)
                    InsertBrush(list, n, parent);
        }
    }
}
}