【发布时间】:2021-01-22 23:02:09
【问题描述】:
假设我有一个包含教师和学生 2 个组的 TreeList,其中有一列“状态”。我正在尝试实现一个按钮来选择所有活跃的教师和学生组。
这是我目前所拥有的
public class MatchStatusOps : TreeListOperation
{
private string fieldName;
private string status;
private TreeList helper;
public TreeListMatchStatusOperation(string fieldName, string status,TreeList helper)
{
this.fieldName = fieldName;
this.status = status;
this.helper = helper;
}
public override void Execute(TreeListNode node)
{
String statusValue = Convert.ToString(node[fieldName]);
if (statusValue.Equals(status))
helper.SetNodeCheckState(node, CheckState.Checked, true);
}
}
然后,我从我的 TreeList 类中调用它
MatchStatusOps operation = new MatchStatusOps("Status","Active",this);
this.NodesIterator.DoOperation(operation);
我无法选中复选框,我想可能是因为选中的节点是状态节点,而不是复选框节点?有什么想法可以让它发挥作用吗?谢谢。
【问题讨论】:
标签: c# asp.net devexpress devexpress-windows-ui