C# Winform 生成的两个DatagridViewTreeViewSelectColumn列该怎么进行数据联动?
R2DatagridViewTreeViewSelectColumn treAss = new R2DatagridViewTreeViewSelectColumn();
treAss.Width = 150;
treAss.HeaderText = css.FEILD_CHNAME;
treAss.Name = "col" + css.FILED_NAME;
treAss.DataPropertyName = css.FILED_NAME;
treAss.OnlySelectLeaf = true;
treAss.OnlySelectEnabled = true;
treAss.IsTextBoxEnabled = false;
treAss.FindParentMode = RFindParentNodeMode.ParentID;
treAss.NodeCodeMember = "Code";
treAss.NodeIDMember = "Id";
treAss.NodeNameMember = "Name";
treAss.NodeParentIDMember = "Parent_id";
treAss.FindParentMode = RFindParentNodeMode.ParentID;
switch (css.TABLE_ELEMENT)
{
case "GFM_ASS_ELE_CARD_PERSON":
List<Person> userDepartList = new List<Person>();
//if (css.FEILD_CHNAME == "使用人")
//{
userDepartList = AgencyManage.Instance.AllPerList.OrderBy(a => a.Code).ToList();
//}
if (css.FEILD_CHNAME == "使用人" && (Global.userRoleId.ToString().Equals("6603") || Global.userRoleId.ToString().Equals("6501")))
{
userDepartList = userDepartList.FindAll(a => a.DEPARTMENT_ID.Contains(comeDepId));
}
List<Person> personList = userDepartList.ToList();
treAss.DataList = personList;
break;
case "GFM_ASS_ELE_DEPARTMENT":
treAss.OnlySelectLeaf = false;
List<Department> dtList = AgencyManage.Instance.DepListByRole;
comeDepId = dtList[0].Id.ToString();
treAss.DataList = dtList.OrderBy(a => a.Code).ToList();
break;}
treAss.Tag = css;
dgvAssetList.Columns.Add(treAss);
然后想如果选了使用部门,那么使用人就应该是该使用部门下的人员
然后我发现赋值是直接赋给一整列了
回答
问题补充:以上是 C# Winform 生成的两个DatagridViewTreeViewSelectColumn列该怎么进行数据联动? 的全部内容, 来源链接: utcz.com/a/67085.html