public void InitData(PopupContainerEdit popupcEdit, DataTable dtSource, string keyFieldName, string parentFieldName, string previewFieldName, bool showCheckBox = false)
        {
            PopupcEdit    = popupcEdit;
            allowCheckBox = showCheckBox;
            TSCommon.SetTreeList(treeList1, showCheckBox);
            if (showCheckBox)
            {
                treeList1.AfterCheckNode += treeList1_AfterCheckNode;
            }
            else
            {
                treeList1.FocusedNodeChanged += treeList1_FocusedNodeChanged;
                //treeList1.AfterFocusNode += treeList1_AfterFocusNode;
            }

            treeList1.KeyFieldName     = keyFieldName;
            treeList1.ParentFieldName  = parentFieldName;
            treeList1.PreviewFieldName = previewFieldName;
            if (!string.IsNullOrWhiteSpace(previewFieldName))
            {
                TreeListColumn tc = new TreeListColumn {
                    Name = previewFieldName, FieldName = previewFieldName, VisibleIndex = 0
                };
                tc.OptionsColumn.AllowEdit = false;
                treeList1.Columns.Add(tc);
            }
            treeList1.DataSource = dtSource;
            treeList1.ExpandAll();
        }
Esempio n. 2
0
 public UCDepartmentInfo()
 {
     InitializeComponent();
     Title          = "部门管理";
     AllowPagePanel = false;
     TSCommon.SetTreeList(treeList1);
     TableName  = "tmo_department";
     PrimaryKey = "dpt_id";
     Columns    = new[] { "dpt_id", "dpt_id dpt_id2", "dpt_name", "dpt_parent", "input_time" };
 }
Esempio n. 3
0
 public UCFunction()
 {
     Title = "权限管理";
     InitializeComponent();
     Init("tmo_function", "func_id");
     OrderByConditons.Add(new OrderByCondition("input_time"));
     AllowPagePanel = false;
     btnAdd.Visible = false;
     TSCommon.SetTreeList(treeList1);
 }