public static string GetAllRole { get { return "[a-zA-Z0-9-]{1,20}"; } }
MDataTable md = MDataTable.CreateFrom(rd.returndata); //增加一行空的 //DataRow dr = dt.NewRow(); //dr["DEPARTMENTCODE"] = "0"; //使用0代替-1,避免出现节点的嵌套显示,因为-1已经作为了一般节点的顶级标识 //dr["PCODE"] = "-1"; //dr["DEPARTMENTNAME"] = "无"; //dt.Rows.InsertAt(dr, 0); this.txtPCODE.Properties.TreeList.KeyFieldName = "DEPARTMENTCODE"; this.txtPCODE.Properties.TreeList.ParentFieldName = "PCODE"; this.txtPCODE.Properties.DataSource = md.ToDataTable(); this.txtPCODE.Properties.ValueMember = "DEPARTMENTCODE"; this.txtPCODE.Properties.DisplayMember = "DEPARTMENTNAME"; //this.textPCode.EditValue = "0";