Back to Devexpress

TreeListNode.Visible Property

windowsforms-devexpress-dot-xtratreelist-dot-nodes-dot-treelistnode-2114302c.md

latest3.5 KB
Original Source

TreeListNode.Visible Property

Gets or sets whether the node is visible. The property allows you to perform node filtering.

Namespace : DevExpress.XtraTreeList.Nodes

Assembly : DevExpress.XtraTreeList.v25.2.dll

NuGet Packages : DevExpress.Win.Navigation, DevExpress.Win.TreeList

Declaration

csharp
[Browsable(false)]
[DefaultValue(true)]
[DXCategory("Behavior")]
public virtual bool Visible { get; set; }
vb
<Browsable(False)>
<DefaultValue(True)>
<DXCategory("Behavior")>
Public Overridable Property Visible As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if the node is visible; otherwise, false.

|

Remarks

If the Visible property is set to true, the node can be accessed by an end-user (directly, by scrolling the control and/or expanding the node’s parent).

You can set the Visible property to false to filter out certain nodes.

Handle the TreeList.CustomRowFilter event to iterate through all nodes and filter out some of them. Read the following topic to learn more: Filtering in Code.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Visible property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-tokenedit-dropdown-with-treelist/CS/TokenEditTest/CustomTokenEditDropDownControl.cs#L93

csharp
if(obj != null && !obj.Leaf.IsMatch(currentFilter)) {
    e.Node.Visible = false;
    e.Handled = true;

winforms-tokenedit-dropdown-with-treelist/VB/TokenEditTest/CustomTokenEditDropDownControl.vb#L105

vb
If obj IsNot Nothing AndAlso (Not obj.Leaf.IsMatch(currentFilter)) Then
    e.Node.Visible = False
    e.Handled = True

See Also

CustomRowFilter

Filtering in Code

TreeListNode Class

TreeListNode Members

DevExpress.XtraTreeList.Nodes Namespace