SoFunction
Updated on 2025-03-07

Implementation method of obtaining TreeList visual area node collection

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&lt;TreeListNode&gt; GetVisibleNodes(this TreeList treeList, Predicate&lt;TreeListNode&gt; conditonHanlder)
{
  List&lt;TreeListNode&gt; _visibleNodes = new List&lt;TreeListNode&gt;();
  RowsInfo _rowsInfo = ;
  foreach (RowInfo ri in _rowsInfo.Rows)
  {
 TreeListNode _curNode = ;
 if (conditonHanlder(_curNode))
 {
   _visibleNodes.Add(_curNode);
 }
  }
  return _visibleNodes;
}
/// &lt;summary&gt;
/// Get the visual area node/// &lt;/summary&gt;
/// &lt;param name="treeList"&gt;TreeList&lt;/param&gt;
/// <returns>Visible area node collection</returns>public static List&lt;TreeListNode&gt; GetVisibleNodes(this TreeList treeList)
{
  return GetVisibleNodes(treeList, n =&gt; 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!