/// <summary> /// 获得子部门列表 /// </summary> private void GetOrganizeList() { // 设置鼠标繁忙状态,并保留原先的状态 var holdCursor = this.Cursor; this.Cursor = Cursors.WaitCursor; this.DTOrganizeList = organizationService.GetDTByParent(UserInfo, this.ParentEntityId); this.DTOrganizeList.DefaultView.Sort = PiOrganizeTable.FieldSortCode; this.dgvInfo.AutoGenerateColumns = false; this.dgvInfo.DataSource = this.DTOrganizeList.DefaultView; this.AddCheckBoxColumn(dgvInfo); // 动态加载树形结构 //if (this.tvOrganize.SelectedNode.Nodes.Count == 0) //{ // foreach (var treeNode in from DataRow dataRow in this.DTOrganizeList.Rows select new TreeNode // { // Text = dataRow[PiOrganizeTable.FieldFullName].ToString(), // Tag = dataRow[PiOrganizeTable.FieldId].ToString() // }) // { // this.tvOrganize.SelectedNode.Nodes.Add(treeNode); // } //} // 设置排序按钮 this.ucSortControl.DataBind(this.dgvInfo, this.permissionEdit); // 设置按钮状态 this.SetControlState(); // 设置鼠标默认状态,原来的光标状态 this.Cursor = holdCursor; }