DevExpress控件TreeList的复选框(2)
node.ParentNode.CheckState = b ? CheckState.Indeterminate : check;
SetCheckedParentNodes(node.ParentNode, check);
}
}
private void GetCheckedID(TreeListNode parentNode)
{
if (parentNode.Nodes.Count == 0)
{
return;//递归终止www.2cto.com
}
foreach (TreeListNode node in parentNode.Nodes)
{
if (node.CheckState == CheckState.Checked)
{
DataRowView drv = treeList1.GetDataRecordByNode(node) as DataRowView;//关键代码
if (drv != null)
{
int GroupID= (int)drv["GroupID"];
lstCheckedOfficeID.Add(GroupID);
}
private void btnOK_Click(object sender, EventArgs e)
{
this.lstCheckedOfficeID.Clear();
if (treeList1.Nodes.Count > 0)
{
foreach (TreeListNode root in treeList1.Nodes)
{
相关新闻>>
- 发表评论
-
- 最新评论 更多>>