alexa
Syncfusion
menu Syncfusion

MAUI

  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class TreeGridView

    The class which has the functionalities of node management and sorting.

    Inheritance
    object
    TreeGridView
    TreeGridQueryableView
    Implements
    ITreeGridViewNotifier
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Syncfusion.Maui.TreeGrid
    Assembly: Syncfusion.Maui.TreeGrid.dll
    Syntax
    public class TreeGridView : ITreeGridViewNotifier, IDisposable

    Constructors

    TreeGridView(SfTreeGrid)

    Initialize a new instance of the TreeGridView class.

    Declaration
    public TreeGridView(SfTreeGrid treeGrid)
    Parameters
    Type Name Description
    SfTreeGrid treeGrid

    TreeGridView(IEnumerable, SfTreeGrid, Type?)

    Initializes a new instance of TreeGridView class.

    Declaration
    public TreeGridView(IEnumerable source, SfTreeGrid treeGrid, Type? sourceType = null)
    Parameters
    Type Name Description
    IEnumerable source

    The source collection.

    SfTreeGrid treeGrid

    An instance of SfTreeGrid

    Type sourceType

    The source type.

    Fields

    IsDisposed

    flag which indicates whether view is disposed or not.

    Declaration
    protected bool IsDisposed
    Field Value
    Type
    bool

    IsInEndeferal

    Gets a value indicating whether this instance is in end defer.

    Declaration
    protected bool IsInEndeferal
    Field Value
    Type Description
    bool

    true if this instance is in end defer; otherwise, false.

    IsInSuspend

    Denotes whether data manipulation operation is suspended or not.

    Declaration
    protected bool IsInSuspend
    Field Value
    Type
    bool

    Properties

    CanAddNew

    Gets a value that indicates whether a new item can be added to the collection.

    Declaration
    public bool CanAddNew { get; }
    Property Value
    Type
    bool

    CanRemove

    Gets a value that indicates whether an item can be removed from the collection.

    Declaration
    public bool CanRemove { get; }
    Property Value
    Type
    bool

    CurrentAddItem

    Gets the item that is being added during the current add transaction.

    Declaration
    public object? CurrentAddItem { get; }
    Property Value
    Type
    object

    EnableRecursiveChecking

    Gets or sets a value which specifies whether recursive node checking is enabled or not. If recursive node checking enabled, node check box state will be changed based on its child or parent check box state.

    Declaration
    public bool EnableRecursiveChecking { get; set; }
    Property Value
    Type Description
    bool

    The default value is False.

    Filter

    Gets or sets the func to apply custom filter on source programmatically.

    Declaration
    public Predicate<object>? Filter { get; set; }
    Property Value
    Type
    Predicate<object>

    IsAddingNew

    Gets a value indicating whether an add transaction is in progress.

    Declaration
    public bool IsAddingNew { get; }
    Property Value
    Type
    bool

    IsInDeferRefresh

    Gets a value which indicates whether view is in DeferRefresh.

    Declaration
    public bool IsInDeferRefresh { get; }
    Property Value
    Type
    bool

    ItemProperties

    Gets the item properties.

    Declaration
    public PropertyDescriptorCollection? ItemProperties { get; }
    Property Value
    Type Description
    PropertyDescriptorCollection

    The item properties.

    NewItemPlaceholderPosition

    Gets or sets the NewItemPlaceholderPosition.

    Declaration
    public NewItemPlaceholderPosition NewItemPlaceholderPosition { get; set; }
    Property Value
    Type
    NewItemPlaceholderPosition

    Nodes

    Gets the collection of Syncfusion.UI.Xaml.TreeGrid.TreeNode

    Declaration
    public TreeNodeCollection Nodes { get; }
    Property Value
    Type
    TreeNodeCollection

    Records

    Gets a flat collection of records (nodes) for column-sizing calculations. Iterates the tree recursively and exposes each visible node so the column sizer can measure cell widths.

    Declaration
    public IReadOnlyList<TreeNode> Records { get; }
    Property Value
    Type
    IReadOnlyList<TreeNode>

    SortComparer

    Gets a value which indicates the comparer which is used for sorting.

    Declaration
    protected IComparer<TreeNode?>? SortComparer { get; }
    Property Value
    Type
    IComparer<TreeNode>

    SortComparers

    Gets the collection of comparer to sort the data based on custom logic .

    Declaration
    public virtual SortComparers? SortComparers { get; }
    Property Value
    Type
    SortComparers
    Remarks

    A comparer that are added to SortComparers collection to apply custom Sorting based on the specified column name and sort direction.

    SourceCollection

    Gets the source collection.

    Declaration
    public IEnumerable? SourceCollection { get; }
    Property Value
    Type
    IEnumerable

    Methods

    AddNew()

    Adds a new item to the collection.

    Declaration
    public object AddNew()
    Returns
    Type Description
    object

    The new item that is added to the collection.

    AddNode(TreeNode, TreeNode, int, int, bool)

    Add particular node as child of the parent node in the specified index.

    Declaration
    public void AddNode(TreeNode parentNode, TreeNode treeNode, int nodeIndex, int sourceIndex = -1, bool needDataShaping = true)
    Parameters
    Type Name Description
    TreeNode parentNode

    parent node.

    TreeNode treeNode

    node needs to be added as child.

    int nodeIndex

    index to insert the node in nodeList.

    int sourceIndex

    if AllowDataShaping should not be considered, sourceIndex will be passed. In sourceList, based on sourceIndex item will be inserted. In NodeList, based on nodeIndex, node will be inserted.

    bool needDataShaping

    specifies whether AllowDataShaping needs to be considered in sorting.

    AddNode(TreeNode, object, int, bool)

    Add node to parent node from data.

    Declaration
    protected virtual void AddNode(TreeNode parentNode, object data, int index, bool needDataShaping = true)
    Parameters
    Type Name Description
    TreeNode parentNode

    parentNode.

    object data

    data.

    int index

    Index to insert the node in child nodes collection of the specified parent node.

    bool needDataShaping

    specifies whether AllowDataShaping needs to be considered in sorting.

    AddNotifyListener(object)

    Add the property changed event to particular record.

    Declaration
    protected void AddNotifyListener(object record)
    Parameters
    Type Name Description
    object record

    the record.

    AttachTreeView(object)

    Associates treeGrid in view.

    Declaration
    public virtual void AttachTreeView(object treeGrid)
    Parameters
    Type Name Description
    object treeGrid

    CancelNew()

    Ends the add transaction and discards the pending new item.

    Declaration
    public void CancelNew()

    CommitNew()

    Ends the add transaction and saves the pending new item.

    Declaration
    public void CommitNew()

    CreateItemPropertiesProvider()

    Creates the item properties provider. Override this method to have return custom IPropertyAccessProvider and have customizations.

    Declaration
    protected virtual IPropertyAccessProvider CreateItemPropertiesProvider()
    Returns
    Type Description
    IPropertyAccessProvider

    IPropertyAccessProvider.

    CreateTreeNode(object, int, bool, TreeNode, Func<TreeGridView>)

    Creates a tree node with the specified item at the specified level with specified state.

    Declaration
    protected TreeNode CreateTreeNode(object item, int level, bool isExpanded, TreeNode parentNode, Func<TreeGridView> getView)
    Parameters
    Type Name Description
    object item

    The item to be presented in the node.

    int level

    The Node level

    bool isExpanded

    Indicates whether node is expanded or not.

    TreeNode parentNode

    The corresponding parent node.

    Func<TreeGridView> getView

    The TreeGridView func.

    Returns
    Type
    TreeNode

    DetachTreeView()

    Detach the grid instance present in the view while disposing the view.

    Declaration
    public virtual void DetachTreeView()

    Dispose()

    Disposes all the resources used by the Syncfusion.UI.Xaml.TreeGrid.TreeGridView class.

    Declaration
    public void Dispose()

    Dispose(bool)

    Disposes all the resources used by the Syncfusion.UI.Xaml.TreeGrid.TreeGridView class.

    Declaration
    protected virtual void Dispose(bool isDisposing)
    Parameters
    Type Name Description
    bool isDisposing

    Indicates whether the call is from Dispose method or from a finalizer.

    EndInit()

    Resumes the data operations and reinitialize the view.

    Declaration
    public void EndInit()

    GetItemProperties()

    Declaration
    public virtual PropertyDescriptorCollection? GetItemProperties()
    Returns
    Type
    PropertyDescriptorCollection

    GetNodeAt(int)

    Gets the node at specified index.

    Declaration
    public virtual TreeNode? GetNodeAt(int index)
    Parameters
    Type Name Description
    int index

    Node at this index will be returned

    Returns
    Type Description
    TreeNode

    Returns the node at specified index

    GetPropertyAccessProvider()

    Gets the PropertyAccessProvider.

    Declaration
    public virtual IPropertyAccessProvider? GetPropertyAccessProvider()
    Returns
    Type Description
    IPropertyAccessProvider

    the IPropertyAccessProvider.

    GetSource()

    Gets the source collection.

    Declaration
    protected virtual IEnumerable? GetSource()
    Returns
    Type Description
    IEnumerable

    the source collection.

    GetTreeGrid()

    Gets treeGrid associated in the view.

    Declaration
    public virtual object GetTreeGrid()
    Returns
    Type Description
    object

    treeGrid.

    IsChildNodeAvailable(TreeNode)

    Checks whether child node will be available for particular tree node.

    Declaration
    [RequiresUnreferencedCode("The IsChildNodeAvailable method is not trim compatible")]
    [RequiresDynamicCode("The IsChildNodeAvailable method relies on dynamic code generation")]
    public bool IsChildNodeAvailable(TreeNode treeNode)
    Parameters
    Type Name Description
    TreeNode treeNode

    the tree node.

    Returns
    Type Description
    bool

    Returns true if the child node will be available; otherwise , false .

    MoveNode(TreeNode, int, int)

    Moves the child node from an index to the another index in child nodes of particular tree node.

    Declaration
    protected virtual void MoveNode(TreeNode treeNode, int oldStartingIndex, int newStartingIndex)
    Parameters
    Type Name Description
    TreeNode treeNode

    tree Node.

    int oldStartingIndex

    oldStartingIndex.

    int newStartingIndex

    newStartingIndex.

    OnCollectionChanged(object, NotifyCollectionChangedEventArgs)

    Method which handles the collection changes.

    Declaration
    protected virtual void OnCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
    Parameters
    Type Name Description
    object sender

    sender.

    NotifyCollectionChangedEventArgs e

    NotifyCollectionChangedEventArgs.

    OnRecordPropertyChanged(object, PropertyChangedEventArgs)

    Raises record property changed event.

    Declaration
    protected virtual void OnRecordPropertyChanged(object sender, PropertyChangedEventArgs e)
    Parameters
    Type Name Description
    object sender

    the record.

    PropertyChangedEventArgs e

    the PropertyChangedEventArgs.

    RaiseNodeCollectionChangedEvent(NotifyCollectionChangedEventArgs)

    Raises the node collection changed event.

    Declaration
    protected void RaiseNodeCollectionChangedEvent(NotifyCollectionChangedEventArgs args)
    Parameters
    Type Name Description
    NotifyCollectionChangedEventArgs args

    NotifyCollectionChangedEventArgs.

    RaisePropertyChanged(string)

    Raises the PropertyChanged event.

    Declaration
    protected void RaisePropertyChanged(string propertyName)
    Parameters
    Type Name Description
    string propertyName

    propertyName.

    Refresh()

    Recreates the view.

    Declaration
    public void Refresh()

    RefreshFilter()

    Refreshes the view when the filtering is applied through Syncfusion.UI.Xaml.TreeGrid.TreeGridView.Filter delegate.

    Declaration
    public void RefreshFilter()

    Remove(object)

    Declaration
    public void Remove(object item)
    Parameters
    Type Name Description
    object item

    RemoveAt(int)

    Removes the item at the specified index.

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    int index

    The specified index.

    RemoveNode(TreeNode, object)

    Remove the data from the child collection of particular tree node.

    Declaration
    protected virtual void RemoveNode(TreeNode parentNode, object data)
    Parameters
    Type Name Description
    TreeNode parentNode

    The parent node. this is null if root node needs to be removed.

    object data

    the data.

    RemoveNotifyListener(object)

    Removes the property changed event of particular record.

    Declaration
    protected void RemoveNotifyListener(object record)
    Parameters
    Type Name Description
    object record

    the record.

    ReplaceNode(TreeNode, IList, IList, int)

    Replaces the items at specified index with the new items in child collection of the particular tree node.

    Declaration
    protected virtual void ReplaceNode(TreeNode treeNode, IList oldItems, IList newItems, int newStartingIndex)
    Parameters
    Type Name Description
    TreeNode treeNode

    treeNode.

    IList oldItems
    IList newItems
    int newStartingIndex

    ResetNodes(TreeNode)

    Clear the child nodes of the particular node.

    Declaration
    protected virtual void ResetNodes(TreeNode parentNode)
    Parameters
    Type Name Description
    TreeNode parentNode

    The Specified parent node.

    Resume()

    Resumes the data manipulation operations in SfTreeGrid.

    Declaration
    public void Resume()

    SetSource(IEnumerable)

    Sets the source collection.

    Declaration
    protected virtual void SetSource(IEnumerable source)
    Parameters
    Type Name Description
    IEnumerable source

    source.

    Suspend()

    Suspends the data manipulation operations in SfTreeGrid.

    Declaration
    public void Suspend()

    UpdateNodesOnPropertyChange(object, PropertyChangedEventArgs, TreeNode)

    Check TreeGridView on property changes and do the actions.

    Declaration
    protected virtual void UpdateNodesOnPropertyChange(object sender, PropertyChangedEventArgs e, TreeNode treeNode = null)
    Parameters
    Type Name Description
    object sender

    updated record.

    PropertyChangedEventArgs e

    PropertyChangedEventArgs.

    TreeNode treeNode

    Tree node.

    Events

    NodeCollectionChanged

    Occurs when node collection is changed.

    Declaration
    public event NotifyCollectionChangedEventHandler? NodeCollectionChanged
    Event Type
    Type
    NotifyCollectionChangedEventHandler

    PropertyChanged

    Occurs when a property value changes.

    Declaration
    public event PropertyChangedEventHandler? PropertyChanged
    Event Type
    Type
    PropertyChangedEventHandler

    RecordPropertyChanged

    Occurs when record property is changed.

    Declaration
    public event PropertyChangedEventHandler? RecordPropertyChanged
    Event Type
    Type
    PropertyChangedEventHandler

    SourceCollectionChanged

    Occurs when source collection is changed.

    Declaration
    public event NotifyCollectionChangedEventHandler? SourceCollectionChanged
    Event Type
    Type
    NotifyCollectionChangedEventHandler

    Implements

    ITreeGridViewNotifier
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved