[DevExpress]利用TreeListOperation获取勾选的节点集合
2013-08-13 15:24
591 查看
public class TreeListCheckedNodesOperation : TreeListOperation { private IDictionary<TreeListNode, IList<TreeListNode>> _checkedNodes = null; public TreeListCheckedNodesOperation() { _checkedNodes = new Dictionary<TreeListNode, IList<TreeListNode>>(); } public override void Execute(TreeListNode node) { if (node.Checked) SaveNodeRelationship(node); } private void SaveNodeRelationship(TreeListNode _currentNode) { if (_currentNode == null) return; NodeType _nodeType = (NodeType)_currentNode.Tag; lock (((ICollection)_checkedNodes).SyncRoot) { if (_nodeType == NodeType.Ch)//若为子节点 ProcessChildNode(_currentNode); if (_nodeType == NodeType.Cab)//若为父节点 ProcessParentNode(_currentNode); } } private void ProcessParentNode(TreeListNode _currentNode) { if (!_checkedNodes.ContainsKey(_currentNode)) _checkedNodes.Add(_currentNode, new List<TreeListNode>()); } private void ProcessChildNode(TreeListNode _currentNode) { TreeListNode _parentNode = _currentNode.ParentNode; if (_parentNode != null) { IList<TreeListNode> _childNodes = null; if (_checkedNodes.ContainsKey(_parentNode)) { _childNodes = _checkedNodes[_parentNode]; if (_childNodes == null) _childNodes = new List<TreeListNode>(); } else { _childNodes = new List<TreeListNode>(); } _childNodes.Add(_currentNode); _checkedNodes[_parentNode] = _childNodes; } } public IDictionary<TreeListNode, IList<TreeListNode>> CheckedNodes { get { return _checkedNodes; } } }
.csharpcode, .csharpcode pre
{
font-size: small;
color: black;
font-family: consolas, "Courier New", courier, monospace;
background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4;
width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }
相关文章推荐
- [DevExpress]利用TreeListOperation获取勾选的节点
- DevExpress获取TreeList可视区域节点集合的实现方法
- DevExpress实现TreeList向上递归获取公共父节点的方法
- DevExpress实现TreeList向上递归获取符合条件的父节点
- [DevExpress]获取TreeListNode选中节点全部路径信息
- DevExpress.XtraTreeList.TreeList 控件如何找到当前被选中的节点
- DevExpress实现TreeList节点互斥的方法
- [DevExpress]TreeList展开指定类型级别的节点
- DevExpress之TreeList节点绑定图片
- dev TreeList 获取可视区域节点方法
- 获取CxDBTreeList所有父节点
- Devexpress TreeList控件绑定显示父子节点对像
- TreeList 的 增加、删除节点-----DevExpress
- 关于DEV里treelist获取节点ID
- 如何获取TreePanel中勾选了CheckBox的节点集合【Ext.Net 1.0】
- 使用List数据集合,利用DevExpress.XtraReports开发Master-Detail报表
- DEV treeList 获取 ListcheckBox选中节点内容
- DevExpress TreeList 拖动时中如何判断源节点作为目标节点的子节点还是兄弟节点
- TreeList获取节点中的值
- DevExpress获取节点下可视区域子节点集合的实现方法