Class TreeModel
The TreeModel maintains a hierarchical collection of expandable TreeNode items. A flattened representations of the hierarchy of nodes can be accessed through the VisibleNodes property where each visible node is mapped to a row index and vice versa. TreeNodesFlattenedList also implements ILineSizeHost and the VirtualTreeView assigns it to RowHeightsProvider in order to be able to pixel scroll through visible and expanded nodes.
Each node can have a unique height but a default height for all nodes can be set with the DefaultHeight property. Each node also maintains its expansion state and when collapsing, expanding a grand parent node all expansion state of child elements are remembered.
The NodeItemProperties property can hold a collection of PropertyDescriptors of the underlying data source. MappingName identifies properties in this collection so that cells can display values from the Data of a TreeNode.
Inheritance
Namespace: Syncfusion.Windows.Controls.VirtualTreeView
Assembly: Syncfusion.GridCommon.WPF.dll
Syntax
public class TreeModel : Object
Constructors
TreeModel()
Initializes a new instance of the TreeModel class.
Declaration
public TreeModel()
Properties
CellStyle
Gets or sets the default style for cells in the model.
Declaration
public TreeStyleInfo CellStyle { get; set; }
Property Value
Type | Description |
---|---|
TreeStyleInfo | The cell style. |
ColumnHeaderStyle
Gets or sets the default style for column headers in the model.
Declaration
public TreeStyleInfo ColumnHeaderStyle { get; set; }
Property Value
Type | Description |
---|---|
TreeStyleInfo | The column header style. |
Columns
Gets or sets the columns.
Declaration
public TreeColumns Columns { get; set; }
Property Value
Type | Description |
---|---|
TreeColumns | The columns. |
DefaultHeight
Gets or sets the default height of nodes.
Declaration
public double DefaultHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default height. |
DefaultItemRows
Gets or sets the number of rows for each node. (TODO: Not sure if this is fully implemented.)
Declaration
public int DefaultItemRows { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The default item rows. |
DefaultWidth
Gets or sets the default width of columns.
Declaration
public double DefaultWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default width. |
FooterColumnCount
Gets or sets the footer column count.
Declaration
public int FooterColumnCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The footer column count. |
FooterRowCount
Gets or sets the footer row count.
Declaration
public int FooterRowCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The footer row count. |
HeaderColumnCount
Gets or sets the header column count.
Declaration
public int HeaderColumnCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The header column count. |
HeaderHeight
Gets or sets the height of the header.
Declaration
public double HeaderHeight { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The height of the header. |
HeaderRowCount
Gets or sets the header row count.
Declaration
public int HeaderRowCount { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The header row count. |
Levels
Gets or sets the levels.
Declaration
public TreeLevels Levels { get; set; }
Property Value
Type | Description |
---|---|
TreeLevels | The levels. |
NodeItemProperties
Gets or sets the collection of PropertyDescriptors of the underlying data source. MappingName identifies properties in this collection so that cells can display values from the Data of a TreeNode.
Declaration
public PropertyDescriptorCollection NodeItemProperties { get; set; }
Property Value
Type | Description |
---|---|
System.ComponentModel.PropertyDescriptorCollection | The node item properties. |
RootNode
Gets the root node.
Declaration
public TreeNode RootNode { get; }
Property Value
Type | Description |
---|---|
TreeNode | The root node. |
VisibleNodes
Gets the visible nodes which is a flattened representations of the hierarchy of nodes where each visible node is mapped to a row index and vice versa. TreeNodesFlattenedList also implements ILineSizeHost and the VirtualTreeView assigns it to RowHeightsProvider in order to be able to pixel scroll through visible and expanded nodes.
Declaration
public TreeNodesFlattenedList VisibleNodes { get; }
Property Value
Type | Description |
---|---|
TreeNodesFlattenedList | The visible nodes. |
Methods
add_NodeCollapsed(TreeNodeEventHandler)
Declaration
public void add_NodeCollapsed(TreeNodeEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeEventHandler | value |
add_NodeExpanded(TreeNodeEventHandler)
Declaration
public void add_NodeExpanded(TreeNodeEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeEventHandler | value |
RaiseLineCountChanged()
Raises the LineCountChanged event.
Declaration
public void RaiseLineCountChanged()
RaiseNodeCollapsed(TreeNodeEventArgs)
Raises the NodeCollapsed event.
Declaration
public void RaiseNodeCollapsed(TreeNodeEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeEventArgs | e | The TreeNodeEventArgs instance containing the event data. |
RaiseNodeExpanded(TreeNodeEventArgs)
Raises the NodeExpanded event.
Declaration
public void RaiseNodeExpanded(TreeNodeEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeEventArgs | e | The TreeNodeEventArgs instance containing the event data. |
remove_NodeCollapsed(TreeNodeEventHandler)
Declaration
public void remove_NodeCollapsed(TreeNodeEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeEventHandler | value |
remove_NodeExpanded(TreeNodeEventHandler)
Declaration
public void remove_NodeExpanded(TreeNodeEventHandler value)
Parameters
Type | Name | Description |
---|---|---|
TreeNodeEventHandler | value |
Events
LineCountChanged
Occurs when the visible line count changed for example if nodes were expanded or collapsed.
Declaration
public event EventHandler LineCountChanged
Event Type
Type |
---|
System.EventHandler |
NodeCollapsed
Occurs when a node was collapsed.
Declaration
public event TreeNodeEventHandler NodeCollapsed
Event Type
Type |
---|
TreeNodeEventHandler |
NodeExpanded
Occurs when node was expanded.
Declaration
public event TreeNodeEventHandler NodeExpanded
Event Type
Type |
---|
TreeNodeEventHandler |