menu

WinUI

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class TreeNode - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class TreeNode

    Represents a class that provides the implementation of Tree nodes in SfTreeGrid.

    Inheritance
    System.Object
    TreeNode
    Implements
    System.IDisposable
    System.ComponentModel.INotifyPropertyChanged
    Namespace: Syncfusion.UI.Xaml.TreeGrid
    Assembly: Syncfusion.Grid.WinUI.dll
    Syntax
    public class TreeNode : Object, IDisposable, INotifyPropertyChanged

    Constructors

    TreeNode()

    Initializes a new instance of TreeNode class.

    Declaration
    public TreeNode()

    Properties

    ChildNodes

    Gets or sets the ChildNodes.

    Declaration
    public TreeNodes ChildNodes { get; }
    Property Value
    Type
    TreeNodes

    HasChildNodes

    Gets the value which indicates whether the node has a child node(s) or not.

    Declaration
    public bool HasChildNodes { get; }
    Property Value
    Type
    System.Boolean

    HasVisibleChildNodes

    Gets the value which indicates whether the node has a child node(s) displayed in a View(matches filtering criteria) or not.

    Declaration
    public bool HasVisibleChildNodes { get; }
    Property Value
    Type
    System.Boolean

    IsChecked

    Gets a value which indicates whether node is checked or not.

    Declaration
    public Nullable<bool> IsChecked { get; }
    Property Value
    Type
    System.Nullable<System.Boolean>

    IsExpanded

    Gets or sets a value indicating whether the TreeNode is expanded or not.

    Declaration
    public bool IsExpanded { get; set; }
    Property Value
    Type
    System.Boolean

    IsFiltered

    Gets or sets a value that indicates whether node is filtered or not.

    Declaration
    public bool IsFiltered { get; }
    Property Value
    Type Description
    System.Boolean

    trueIf the node is filtered (filter condition is not matched). It did not show in view;Otherwise,false.The default value is false.

    See Also
    Filter

    Item

    Gets or sets the item.

    Declaration
    public object Item { get; }
    Property Value
    Type
    System.Object

    Level

    Gets or sets the level.

    Declaration
    public int Level { get; }
    Property Value
    Type
    System.Int32

    ParentNode

    Gets or sets the Parent node.

    Declaration
    public TreeNode ParentNode { get; }
    Property Value
    Type
    TreeNode

    VisibleNodesCount

    Gets the number of visible child nodes(Child nodes which match the filtering criteria).

    Declaration
    public int VisibleNodesCount { get; }
    Property Value
    Type
    System.Int32

    Methods

    Dispose()

    Disposes all the resources used by the TreeNode class.

    Declaration
    public void Dispose()

    Dispose(Boolean)

    Disposes all the resources used by the TreeNode class.

    Declaration
    protected virtual void Dispose(bool disposing)
    Parameters
    Type Name Description
    System.Boolean disposing

    true to release all the resources.

    GetYAmountCache()

    Gets the YAmountCache.

    Declaration
    public virtual int GetYAmountCache()
    Returns
    Type Description
    System.Int32

    The YAmountCache.

    PopulateChildNodes()

    Populates the child nodes without expanding it.

    Declaration
    public void PopulateChildNodes()

    PopulateChildNodes(IEnumerable<Object>)

    Load the child nodes and update the UI when we populate the child items using async and await

    Declaration
    public void PopulateChildNodes(IEnumerable<object> childItems)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Object> childItems

    PopulateChildNodes(IEnumerable)

    Populates the child nodes from the given child items collection.

    Declaration
    public void PopulateChildNodes(IEnumerable childItems)
    Parameters
    Type Name Description
    System.Collections.IEnumerable childItems

    The collection of child items to be populated as child nodes.

    SetCheckedState(Nullable<Boolean>, Boolean, Boolean)

    Sets the IsChecked property with additional parameter to handle recursive checking.

    Declaration
    public void SetCheckedState(Nullable<bool> value, bool canUpdateParentNode = true, bool canUpdateChildNodes = true)
    Parameters
    Type Name Description
    System.Nullable<System.Boolean> value

    New value for IsChecked.

    System.Boolean canUpdateParentNode

    specifies whether need to update parent node's state when EnableRecursiveChecking is true.

    System.Boolean canUpdateChildNodes

    specifies whether need to update child node's state when EnableRecursiveChecking is True.

    SetDirty()

    Sets the dirty. When this is set to true, the YAmountCache and maxLevel will be re-computed for the tree node.

    Declaration
    public void SetDirty()

    Events

    PropertyChanged

    Occurs when a property value changes.

    Declaration
    public event PropertyChangedEventHandler PropertyChanged
    Event Type
    Type
    System.ComponentModel.PropertyChangedEventHandler

    Implements

    System.IDisposable
    System.ComponentModel.INotifyPropertyChanged
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved