This article shows the implementation method of DevExpress to obtain the visual area node collection of TreeList, which is a more practical technique. Share it for your reference. The specific implementation method is as follows:
The key code is as follows:
/// <summary> /// Get the visual area node/// </summary> /// <param name="treeList">TreeList</param> /// <param name="conditonHanlder">Conditional delegation</param>/// <returns>Visible area node collection</returns>public static List<TreeListNode> GetVisibleNodes(this TreeList treeList, Predicate<TreeListNode> conditonHanlder) { List<TreeListNode> _visibleNodes = new List<TreeListNode>(); RowsInfo _rowsInfo = ; foreach (RowInfo ri in _rowsInfo.Rows) { TreeListNode _curNode = ; if (conditonHanlder(_curNode)) { _visibleNodes.Add(_curNode); } } return _visibleNodes; } /// <summary> /// Get the visual area node/// </summary> /// <param name="treeList">TreeList</param> /// <returns>Visible area node collection</returns>public static List<TreeListNode> GetVisibleNodes(this TreeList treeList) { return GetVisibleNodes(treeList, n => 1 == 1); }
The code usage method is as follows:
((n => () == ).());
I hope that the examples described in this article will be helpful to everyone’s C# programming!