menu

WPF

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

    Show / Hide Table of Contents

    Class GridTreeControl

    A ContentControl derived class that aggregates the functionality of a GridTreeControlImpl object into a ContentControl. GridTreeControlImpl is a GridControl derived class that displays multicolumn tree data in a tree-like grid. You populate the tree by handling a single event, RequestTreeItems in which you return a list of objects that belong to a particular node. GridTreeControl wraps this tree grid into a ContentControl object that allows you access to its control Template.

    Inheritance
    System.Object
    GridTreeControl
    Implements
    System.IDisposable
    Namespace: Syncfusion.Windows.Controls.Grid
    Assembly: Syncfusion.Grid.Wpf.dll
    Syntax
    [Obsolete("This control is obsolete. Use new SfTreeGrid in Syncfusion.SfGrid.WPF assembly instead.")]
    public class GridTreeControl : ContentControl, IDisposable
    Remarks

    While handling RequestTreeItems is the only thing required for data to appear in your tree, you can use additional property setting to customized the look and feel of the tree. You use the Columns collection to define content and order of the multiple columns appearing in the tree. For each column, you can specify Column.StyleInfo which is a GridStyleInfo object that controls the grid cell display properties (like BackColor, Format, Fonts, etc.) of a the column.

    The TreeGridControl also supports sorting by clicking on a column header. There are also tree-wide properties like ReadOnly, SupportRowSizing, MarkRowBrush, ColumnHeaderStyle, FreezeExpandColumn, LevelStyles, RowHeaderWidth, ShowColumnHeaders, ShowColumnHeaderBorders, AllowSorting and ShowRowHeaders that allow you to control the look and feel of the tree grid.

    The TreeGridControlImpl is bound to a collection of GridNode objects found in TreeGridControl.Nodes. There is a one to one mapping between the rows in the underlying GridControl and GridNodes in TreeGridControlImpl.Nodes. Given a GridNode, you can get at the underlying data object passed in via the RequestTreeItems event by referencing GridNode.Item. The property, GridTreeControl.InternalGrid gives you access to the associated TreeGridControlImpl object.

    Constructors

    GridTreeControl()

    Default constructor.

    Declaration
    public GridTreeControl()

    Fields

    AllowDragColumnsProperty

    DependencyProperty for AllowDragColumns.

    Declaration
    public static readonly DependencyProperty AllowDragColumnsProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    AllowSortProperty

    DependencyProperty for AllowSort.

    Declaration
    public static readonly DependencyProperty AllowSortProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    AutoGenerateColumnsInfoProperty

    Declaration
    public static readonly DependencyProperty AutoGenerateColumnsInfoProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ChildPropertyNameChangedEvent

    Declaration
    public static readonly RoutedEvent ChildPropertyNameChangedEvent
    Field Value
    Type
    System.Windows.RoutedEvent

    ChildPropertyNameProperty

    DependencyProperty for ChildPropertyName.

    Declaration
    public static readonly DependencyProperty ChildPropertyNameProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ContextMenuStyleProperty

    Declaration
    public static readonly DependencyProperty ContextMenuStyleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    CustomVisualStyleProperty

    DependencyProperty for VisualStyle.

    Declaration
    public static readonly DependencyProperty CustomVisualStyleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    DefaultColumnWidthProperty

    DependencyProperty for DefaultColumnWidth.

    Declaration
    public static readonly DependencyProperty DefaultColumnWidthProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    EnableLegacyStyleProperty

    Declaration
    public static readonly DependencyProperty EnableLegacyStyleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    EnableRenderOptimizationProperty

    DependencyPropery for EnableRenderOptimizationProperty.

    Declaration
    public static readonly DependencyProperty EnableRenderOptimizationProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ExpandGlyphTypeProperty

    Declaration
    public static readonly DependencyProperty ExpandGlyphTypeProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ExpandStateAtStartUpProperty

    Declaration
    public static readonly DependencyProperty ExpandStateAtStartUpProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    FooterRowsProperty

    Declaration
    public static readonly DependencyProperty FooterRowsProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    FrozenRowsProperty

    Declaration
    public static readonly DependencyProperty FrozenRowsProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    HideEmptyChildGlyphsProperty

    DependencyProperty for .

    Declaration
    public static readonly DependencyProperty HideEmptyChildGlyphsProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    IgnoreResetOnListChangedProperty

    Gets or sets whether no action is taken by the GridTreeControl on the occurrence of an IBindingList.ListChangedType.Reset event. If you are binding to a DataTable/DataView, when you call DataTable.AcceptChanges(), the corresponding DataView raises a IBindingList.ListChanged Reset event. When the GridTreeControl responds to this event, its default action is to just reload the entire tree which will cause the expand state of the existing nodes to be lost. So, if you are calling DataTable.AcceptChanges, you can set IgnoreResetOnListChanged = true to avoid losing the existing expand states.

    Declaration
    public static readonly DependencyProperty IgnoreResetOnListChangedProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ItemsSourceChangedEvent

    Declaration
    public static readonly RoutedEvent ItemsSourceChangedEvent
    Field Value
    Type
    System.Windows.RoutedEvent

    ItemsSourceProperty

    DependencyProperty for ItemsSource.

    Declaration
    public static readonly DependencyProperty ItemsSourceProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    NotifyPropertyChangesProperty

    DependencyProperty for NotifyPropertyChanges.

    Declaration
    public static readonly DependencyProperty NotifyPropertyChangesProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ParentPropertyNameChangedEvent

    Declaration
    public static readonly RoutedEvent ParentPropertyNameChangedEvent
    Field Value
    Type
    System.Windows.RoutedEvent

    ParentPropertyNameProperty

    DependencyProperty for ParentPropertyName.

    Declaration
    public static readonly DependencyProperty ParentPropertyNameProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    RequestNodeImageEvent

    Declaration
    public static readonly RoutedEvent RequestNodeImageEvent
    Field Value
    Type
    System.Windows.RoutedEvent

    RequestTreeItemsEvent

    Declaration
    public static readonly RoutedEvent RequestTreeItemsEvent
    Field Value
    Type
    System.Windows.RoutedEvent

    ScrollViewerStyleProperty

    Declaration
    public static readonly DependencyProperty ScrollViewerStyleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    SelectedNodeProperty

    DependencyProperty for SelectedNode property.

    Declaration
    public static readonly DependencyProperty SelectedNodeProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ShowRowHeaderProperty

    DependencyProperty for ShowRowHeader.

    Declaration
    public static readonly DependencyProperty ShowRowHeaderProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    SortClickActionProperty

    Declaration
    public static readonly DependencyProperty SortClickActionProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    SortingOptionsProperty

    Declaration
    public static readonly DependencyProperty SortingOptionsProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    StyleManagerProperty

    Declaration
    public static readonly DependencyProperty StyleManagerProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    TemplateGrid

    Name used for the GridTreeControlImpl object in the default template.

    Declaration
    public const string TemplateGrid = "PART_GridControl"
    Field Value
    Type
    System.String

    TrackSelectionOnCollectionChangeProperty

    Declaration
    public static readonly DependencyProperty TrackSelectionOnCollectionChangeProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    UnboundRowPositionProperty

    Declaration
    public static readonly DependencyProperty UnboundRowPositionProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    UnboundRowsCountProperty

    Declaration
    public static readonly DependencyProperty UnboundRowsCountProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    UpdateModeProperty

    DependencyProperty for UpdateMode property.

    Declaration
    public static readonly DependencyProperty UpdateModeProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    VisualStyleProperty

    DependencyProperty for VisualStyle.

    Declaration
    public static readonly DependencyProperty VisualStyleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    Properties

    AllowAutoSizingNodeColumn

    Gets or sets whether the tree node column's width is automatically adjusted as the node levels increase.

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

    This property is ignored is PercentageSizing is enabled and the node column is marked to participate in the percentage sizing calculations.

    AllowDragColumns

    Gets or sets a value indicating whether [allow drag columns].

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

    true if [allow drag columns]; otherwise, false.

    AllowSort

    Gets or sets a value indicating whether [allow sort].

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

    true if [allow sort]; otherwise, false.

    AutoGenerateColumnsInfo

    Gets or sets a value indicating whether to generate the CellType automatically

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

    true if [auto generate columns info]; otherwise, false.

    AutoPopulateColumns

    If AutoPopulateColumns is set to True, then visible column defined will be populated in the View. else all the columns in the itemsource will be populated in the view

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

    AutosizingNodeColumnOption

    Gets or sets whether Sizing of nodes based on NodeCount or Level

    Declaration
    public GridNodeAutosizingOption AutosizingNodeColumnOption { get; set; }
    Property Value
    Type
    GridNodeAutosizingOption

    ChildPropertyName

    Declaration
    public string ChildPropertyName { get; set; }
    Property Value
    Type
    System.String

    ColumnHeaderStyle

    Gets or sets a GridStyleInfo object that defines the style information for the column headers.

    Declaration
    public GridStyleInfo ColumnHeaderStyle { get; set; }
    Property Value
    Type
    GridStyleInfo

    Columns

    A collection of the TreeColumns that control the number and order of the columns that appear in the Tree.

    Declaration
    public ObservableCollection<GridTreeColumn> Columns { get; set; }
    Property Value
    Type
    System.Collections.ObjectModel.ObservableCollection<GridTreeColumn>

    ContextMenuStyle

    Declaration
    public Style ContextMenuStyle { get; set; }
    Property Value
    Type
    System.Windows.Style

    CustomVisualStyle

    Gets or sets the visual style.

    Declaration
    public IGridTreeVisualStyle CustomVisualStyle { get; set; }
    Property Value
    Type Description
    IGridTreeVisualStyle

    The visual style.

    DefaultColumnWidth

    Gets or sets the default width of the column.

    Declaration
    public double DefaultColumnWidth { get; set; }
    Property Value
    Type Description
    System.Double

    The default width of the column.

    EnableHotRowMarker

    Gets or sets whether the row under the current mouse position is redrawn using the HotRowMarker as a background brush.

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

    EnableLegacyStyle

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

    EnableMultiColumnSorting

    Gets or sets a value indicating whether [enable multi column sorting].

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

    true if [enable multi column sorting]; otherwise, false.

    EnableNodeSelection

    Gets or sets whether your user can select whole row when a cell is clicked with the mouse.

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

    Setting this property to true also sets GridTreeControl.InternalGrid.Model.Options.ListBoxSelectionMode to MultiExtended. If you want the selected behavior to be something other than MultiExtended, you will need to explicitly set it after setting this property.

    EnableRenderCheckIfGlyphNeeded

    Gets or sets whether Sorting are allowed while editing the cells in GridTreeControl.

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

    EnableRenderOptimization

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

    EnableSelections

    Gets or sets whether selections are allowed in teh GridTreeControl.

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

    EnableSortOnEdit

    Gets or sets whether Sorting are allowed while editing the cells in GridTreeControl.

    Declaration
    [Obsolete]
    public bool EnableSortOnEdit { get; set; }
    Property Value
    Type
    System.Boolean

    EnableTriStateSorting

    Gets or sets a value indicating whether [enable tri state sorting].

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

    true if [enable tri state sorting]; otherwise, false.

    ExpandGlyphType

    Gets or sets the type of the glyph shown in the expand cell.

    Declaration
    public GridTreeExpandGlyph ExpandGlyphType { get; set; }
    Property Value
    Type
    GridTreeExpandGlyph
    Remarks

    The default value is a triangle. You can also set a +- glyph, or a +-glyph with tree lines, or a custom drawn glyph. The property NodeColumnWidth reserves the required width of your glyph. The default value of NodeColumnWidth is 10 which is the setting used for the triangle glyph. For the +- glyph, the value of NodeColumnWidth is set to 14. If you want to explicitly provide a particular NodeColumnWidth, then you need to explicitly reset its value after you set ExpandGlyphType as setting ExpandGlypType also possibly resets NodeColumnWidth.

    ExpandStateAtStartUp

    Gets / Sets the ExandStateAtStartUp property.

    Declaration
    public GridTreeStartUpExpandState ExpandStateAtStartUp { get; set; }
    Property Value
    Type
    GridTreeStartUpExpandState

    FooterRows

    Gets or sets the number of non-scrolling rows at bottom of the GridTreeControl.

    Declaration
    public int FooterRows { get; set; }
    Property Value
    Type Description
    System.Int32

    The number of non-scrolling rows at bottom. The default value is zero.

    Remarks

    Footer rows are always displayed and it can’t be scrolled out of visibility.

    FreezeExpandColumn

    Gets of sets whether the column with the expand/contract glyph is scrollable.

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

    FrozenRows

    Gets or sets the FrozenRows count.

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

    HideEmptyChildGlyphs

    Gets or sets whether empty child nodes show the +/- cells when they are initially displayed.

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

    true if empty child nodes should not show the +/- ; otherwise, false.

    Remarks

    The default GridTreeControl raises the RequestTreeItem event for each child node as it becomes visible the first time so the GridTreeControl will not display the +/- for nodes that have no children. If you set this property to false, the GridTreeControl will not raise the RequestTreeItems for the child until the child node is clicked to be expanded. At that point, if the child node has no children, the +/- will go away.

    IgnoreResetOnListChanged

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

    ItemsSource

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

    LevelStyles

    Gets or sets a collection of GridStyleInfo objects that will be applied to specific levels.

    Declaration
    public List<GridStyleInfo> LevelStyles { get; set; }
    Property Value
    Type
    System.Collections.Generic.List<GridStyleInfo>

    Model

    Gets the GridTreeModel model.

    Declaration
    public GridTreeModel Model { get; }
    Property Value
    Type Description
    Syncfusion.Windows.Controls.Grid.GridTreeModel

    The model.

    NotifyPropertyChanges

    Gets or sets a value indicating whether NotifyPropertyChanges is true / false. Set this to true, GridTreeControl will listen to property changes.

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

    true if [notify property changes]; otherwise, false.

    ParentPropertyName

    Declaration
    public string ParentPropertyName { get; set; }
    Property Value
    Type
    System.String

    PercentSizingBehavior

    Gets or sets the percentage sizing behavior in the GridTreeControl.

    Declaration
    public GridPercentColumnSizingBehavior PercentSizingBehavior { get; set; }
    Property Value
    Type
    GridPercentColumnSizingBehavior
    Remarks

    Set the GridTreeColumn.PercentWidth property to enable a particular column to participate in the automatic sizing as the TreeGridControl client width changes. Depending upon the value of PercentSizingBehavior, the free client width left after all the columns whose PrecentWidth is not set has been subtracted, is proportionally allocated among all those columns whose PercentWidth is set.

    ReadOnly

    Gets or sets whether the GridTreeControl is ReadOnly.

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

    RowHeaderWidth

    Gets or sets the width of the row header column.

    Declaration
    public double RowHeaderWidth { get; set; }
    Property Value
    Type
    System.Double

    ScrollViewerStyle

    Declaration
    [Obsolete("Not sure if needed")]
    public Style ScrollViewerStyle { get; set; }
    Property Value
    Type
    System.Windows.Style

    SelectedNode

    Gets or sets the selected Node.

    Declaration
    public object SelectedNode { get; set; }
    Property Value
    Type Description
    System.Object

    The selected Node.

    SelectedNodes

    Gets a collection of the selected nodes within the GridTreeControl.

    Declaration
    public GridSelectedTreeNodes SelectedNodes { get; }
    Property Value
    Type
    GridSelectedTreeNodes
    Remarks

    If this property is acessed before the InternalGrid has been initialized, it will return null.

    SelfRelationRootValue

    Gets or sets the value that defines the root object in a self-related tree when ItemsSource is used to define the underlying tree data.

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

    ShowColumnHeaders

    Gets or sets whether a header row is visible

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

    ShowExpandColumnBorders

    Gets or sets whether the grid lines are seen in the expand column.

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

    ShowRowHeader

    Gets or sets a value indicating whether [show row header].

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

    true if [show row header]; otherwise, false.

    SortClickAction

    Enables/Disables the sorting on mouse double click.

    Declaration
    public SortClickAction SortClickAction { get; set; }
    Property Value
    Type Description
    SortClickAction

    The sort click action.

    SortingOptions

    Declaration
    public GridTreeSortingOptions SortingOptions { get; set; }
    Property Value
    Type
    GridTreeSortingOptions

    SourceType

    Declaration
    public Type SourceType { get; set; }
    Property Value
    Type
    System.Type

    StyleManager

    Declaration
    public GridTreeStyleManager StyleManager { get; set; }
    Property Value
    Type
    GridTreeStyleManager

    SupportNodeImages

    Gets or sets whether an event is raised to request an image to be displayed for a node.

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

    SupportRowSizing

    Gets or sets whether your user can size row heights with the mouse.

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

    SupportsVisualStyles

    Gets or sets whether the GridTreeControl should adjust its appearance according to the setting.

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

    TrackSelectionOnCollectionChange

    Gets or Sets whether to track the selection when the binded collection changed

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

    UnboundRowPosition

    Gets or sets the UnboundRowPosition

    Declaration
    public Position UnboundRowPosition { get; set; }
    Property Value
    Type
    Position

    UnboundRowsCount

    Gets or sets the Bnbound Row Count for the Model. This would add additional rows to the Top of the Grid after the Column headers or Bottom of the Grid based on UnboundRowPosition

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

    UpdateMode

    Gets or sets the update mode.

    Declaration
    public UpdateMode UpdateMode { get; set; }
    Property Value
    Type Description
    UpdateMode

    The update mode.

    VisualStyle

    Gets or sets the visual style.

    Declaration
    public VisualStyle VisualStyle { get; set; }
    Property Value
    Type Description
    VisualStyle

    The visual style.

    Methods

    AutoPopulateColumnInfo()

    This method is only called if the Columns collection has not been explicitly populated by the user before the initial raising of the RequestTreesItems event in OnLoad.

    Declaration
    public void AutoPopulateColumnInfo()

    CollapseAllNodes()

    Collapses all expanded nodes.

    Declaration
    public void CollapseAllNodes()

    CollapseAllNodes(GridTreeNode)

    Collapse all passed-in node as well as child nodes of the passed-in node.

    Declaration
    public void CollapseAllNodes(GridTreeNode n)
    Parameters
    Type Name Description
    GridTreeNode n

    The node to be collapsed.

    CollapseNode(GridTreeNode)

    Collapses a single node.

    Declaration
    public void CollapseNode(GridTreeNode n)
    Parameters
    Type Name Description
    GridTreeNode n

    The node to be collapsed.

    CollapseNode(Int32)

    Collapse the GridNode that corresponds to the given grid row index.

    Declaration
    public void CollapseNode(int gridRowIndex)
    Parameters
    Type Name Description
    System.Int32 gridRowIndex

    The rowIndex of the GridNode to be collapsed.

    Dispose()

    Declaration
    public void Dispose()

    ExpandAllNodes()

    Expand all nodes.

    Declaration
    public void ExpandAllNodes()

    ExpandAllNodes(GridTreeNode)

    Expands the given node and all of its child nodes.

    Declaration
    public void ExpandAllNodes(GridTreeNode n)
    Parameters
    Type Name Description
    GridTreeNode n

    The node to be expanded.

    ExpandNode(GridTreeNode)

    Expands the single node.

    Declaration
    public void ExpandNode(GridTreeNode n)
    Parameters
    Type Name Description
    GridTreeNode n

    The node to be expanded.

    ExpandNode(Int32)

    Expand the GridNode that corresponds to the given grid row index.

    Declaration
    public void ExpandNode(int gridRowIndex)
    Parameters
    Type Name Description
    System.Int32 gridRowIndex

    The rowIndex of the GridNode to be expanded.

    OnApplyTemplate()

    Declaration
    public override void OnApplyTemplate()

    OnCreatingTreeNode(GridTreeCreatingNodeEventArgs)

    Raises the CreatingNode event.

    Declaration
    protected virtual void OnCreatingTreeNode(GridTreeCreatingNodeEventArgs e)
    Parameters
    Type Name Description
    GridTreeCreatingNodeEventArgs e

    The event argument.

    OnExpandStateChanged(GridTreeNode, GridTreeNodeActions)

    Raises the ExpandStateChanged event.

    Declaration
    public void OnExpandStateChanged(GridTreeNode node, GridTreeNodeActions action)
    Parameters
    Type Name Description
    GridTreeNode node

    The node that was clicked.

    GridTreeNodeActions action

    The action that was taken.

    OnExpandStateChanging(GridTreeNode, GridTreeNodeActions)

    Raises the ExpandStateChanging event.

    Declaration
    public bool OnExpandStateChanging(GridTreeNode node, GridTreeNodeActions action)
    Parameters
    Type Name Description
    GridTreeNode node

    The node that was clicked.

    GridTreeNodeActions action

    The action to be taken.

    Returns
    Type Description
    System.Boolean

    True if the action should be completed, false otherwise.

    OnNodesSorted()

    Called after sorting the nodes in GridTreeControl

    Declaration
    protected virtual void OnNodesSorted()

    OnQueryVisibleColumnInfo(GridTreeQueryVisibleColumnInfoEventArgs)

    Raises the QueryVisibleColumnInfo event.

    Declaration
    protected virtual void OnQueryVisibleColumnInfo(GridTreeQueryVisibleColumnInfoEventArgs Args)
    Parameters
    Type Name Description
    GridTreeQueryVisibleColumnInfoEventArgs Args

    The GridTreeQueryVisibleColumnInfoEventArgs instance containing the event data.

    Populate()

    Call this method to repopulate a GridTreeControl if the GridTreeControl has been previously reset to an empty tree by calling the Reset() method.

    Declaration
    public void Populate()
    Remarks

    If you are using the RequestTreeItems event to populate your tree, just calling Populate() will raise the appropriate events. But if you are populating the tree by setting an ItemsSource property (along with possibly a ChildPropertyName, ParentPropertyName, or SelfRelationRootValue), then you also must set these properties properly before calling the Populate method.

    RaiseCreatingTreeNode(GridTreeCreatingNodeEventArgs)

    Raises the CreatingTreeNode event.

    Declaration
    public void RaiseCreatingTreeNode(GridTreeCreatingNodeEventArgs e)
    Parameters
    Type Name Description
    GridTreeCreatingNodeEventArgs e

    The event argument.

    RaiseQueryVisibleColumnInfo(GridTreeQueryVisibleColumnInfoEventArgs)

    Raises the query visible column info.

    Declaration
    public void RaiseQueryVisibleColumnInfo(GridTreeQueryVisibleColumnInfoEventArgs e)
    Parameters
    Type Name Description
    GridTreeQueryVisibleColumnInfoEventArgs e

    The GridTreeQueryVisibleColumnInfoEventArgs instance containing the event data.

    RaiseRequestNodeImage(GridTreeRequestNodeImageEventArgs)

    Declaration
    public void RaiseRequestNodeImage(GridTreeRequestNodeImageEventArgs e)
    Parameters
    Type Name Description
    GridTreeRequestNodeImageEventArgs e

    RaiseRequestTreeItems(GridTreeRequestChildListEventArgs)

    Declaration
    public void RaiseRequestTreeItems(GridTreeRequestChildListEventArgs e)
    Parameters
    Type Name Description
    GridTreeRequestChildListEventArgs e

    Reset()

    This method clears the GridTreeControl of all nodes and column schema information.

    Declaration
    public void Reset()
    Remarks

    If you are using an ItemsSource property (along with possibly a ChildPropertyName, ParentPropertyName, or SelfRelationRootValue), then these properties will also be reset by a call to this Reset method.

    Events

    ChildPropertyNameChanged

    Declaration
    public event GridRoutedEventHandler ChildPropertyNameChanged
    Event Type
    Type
    GridRoutedEventHandler

    CreatingTreeNode

    Event which is raised as GridTreeNodes are created so derived tree nodes can be used.

    Declaration
    public event GridTreeCreatingNodeHandler CreatingTreeNode
    Event Type
    Type
    GridTreeCreatingNodeHandler

    ExpandStateChanged

    A notification event that is raised after a node has been expand or collapsed as the result of the user clicking the expand button.

    Declaration
    public event GridTreeNodeEventHandler ExpandStateChanged
    Event Type
    Type
    GridTreeNodeEventHandler

    ExpandStateChanging

    A cancelable event raised before the expand state of a node changes as a result of the user clicking the expand button.

    Declaration
    public event GridTreeNodeCancelEventHandler ExpandStateChanging
    Event Type
    Type
    GridTreeNodeCancelEventHandler

    ItemsSourceChanged

    Declaration
    public event GridRoutedEventHandler ItemsSourceChanged
    Event Type
    Type
    GridRoutedEventHandler

    ModelLoaded

    Occurs when the Model is loaded and the Template is applied. This is useful to listen to Model events when the control is initialized.

                
                this.treeControl.ModelLoaded += (sender, args) =>
                {
                    this.treeControl.Model.QueryCellInfo += new
    Syncfusion.Windows.Controls.Grid.GridQueryCellInfoEventHandler(Model_QueryCellInfo);
                };
    Declaration
    public event EventHandler ModelLoaded
    Event Type
    Type
    System.EventHandler

    NodesPopulated

    Occurs after the Nodes are populated in the Grid.

    Declaration
    public event EventHandler NodesPopulated
    Event Type
    Type
    System.EventHandler

    ParentPropertyNameChanged

    Declaration
    public event GridRoutedEventHandler ParentPropertyNameChanged
    Event Type
    Type
    GridRoutedEventHandler

    QueryVisibleColumnInfo

    Occurs when [query visible column info].

    Declaration
    public event GridTreeQueryVisibleColumnInfoEventHandler QueryVisibleColumnInfo
    Event Type
    Type
    GridTreeQueryVisibleColumnInfoEventHandler

    RequestNodeImage

    This event is used to request an image for the specified node item. This event is only raised if SupportNodeImages is true.

    Declaration
    public event GridTreeRequestNodeImageHandler RequestNodeImage
    Event Type
    Type
    GridTreeRequestNodeImageHandler

    RequestTreeItems

    This event is used to request an IEnumerable object that holds the child item objects for a particular parent item.

    Declaration
    public event GridTreeRequestTreeItemsHandler RequestTreeItems
    Event Type
    Type
    GridTreeRequestTreeItemsHandler
    Remarks

    In order to see data displayed in the TreeGrid, you must handle this event. The events args pass in a parent object, and your event handler needs to provide an IEnumerable object that contains the childs objects for this pareent object. If the parent object is null, you should provide the collection of root objects for the tree.

    Implements

    System.IDisposable

    Extension Methods

    GridPrintExtensions.ShowPrintDialog(GridTreeControl)
    GridPrintExtensions.ShowPrintDialog(GridTreeControl, Action<GridPrintDialog>)
    GridPrintExtensions.Print(GridTreeControl, Action<PrintDialog>)
    GridPrintExtensions.Print(GridTreeControl)
    GridTreeControlExportExtensions.ExportToExcel(GridTreeControl, GridRangeInfo, String, ExcelVersion)
    GridTreeControlExportExtensions.ExportToExcel(GridTreeControl, GridRangeInfo, String, ExcelVersion, GridCellExportToExcelHandler)
    GridTreeControlExportExtensions.ExportToExcel(GridTreeControl, String, ExcelVersion)
    GridTreeControlExportExtensions.ExportToExcel(GridTreeControl, String, ExcelVersion, GridCellExportToExcelHandler)
    GridTreeControlExportExtensions.ExportToExcel(GridTreeControl, GridRangeInfo, IWorksheet, IRange)
    GridTreeControlExportExtensions.ExportToExcel(GridTreeControl, GridRangeInfo, IWorksheet, IRange, GridCellExportToExcelHandler)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved