BinaryTreeListView
A custom TreeView derived class that renders and manages its data in several columns, each column's row being rendered in an hierarchical manner.
public class BinaryTreeListView : TreeView
Inherits from / implements: TreeView
Remarks
The control is very simple to use. All that you will need to do typically is:
1. Create an instance of BinaryTreeListView control.
2. Create as many needed instances of GridViewColumns.
3. Set the ItemsSource property with the data-source that will feed the data for this control.
This can come from any sources like: XML, CLR objects/collections, result of LINQ queries, DataTable, simple CLR arrays, etc.
4. Specify which column you would like the control to render as a tree-list column. TO do this set the TreeListViewColumnIndex or TreeListViewColumn properties with relevant value.
Note that you can also add rows pro grammatically. It is not a necessity that the data comes from DataBinding / data-source.
That is all to it. Run the application and you will see your data in a hierarchical manner using a TreeListView style.
You could also setup other properties in the control to enhance the user experience.
Members at a glance
BinaryTreeListView | Initializes a new instance of the BinaryTreeListView class. |
CollapseButtonImage | Gets or sets the collapse button image. |
Columns | Gets the columns collection in the control. |
ExpandButtonImage | Gets or sets the expand button image. |
ExpandCollapseBorderBrush | Gets or sets the expand / collapse border brush. |
ExpandCollapseButtonImageStretch | Gets or sets the expand collapse button image stretch. |
ExpandCollapseControlFillBrush | Gets or sets the expand / collapse glyph fill brush. |
ExpandCollapsePlusMinusBrush | Gets or sets the expand / collapse plus / minus brush. |
IsMultiSelectionEnabled | Gets or sets whether multi-selection of notes is enabled. |
IsNodesConnectingLineVisible | Gets or sets a value indicating whether the control should draw the nodes connecting line. |
IsShiftMultiSelectionEnabled | Gets or sets whether the SHIFT + selection is enabled for multi-selection of nodes. By default this value is false. |
MultiSelectedItems | Gets the multi-selected items. |
NodesConnectingLineBrush | Gets or sets the nodes connecting line brush. |
RenderCollapseExpandVisualAlwaysInTheFirstColumn | Gets or sets a value indicating whether to always render the first column as the tree-list view colum. |
SelectionBackgroundBrush | Gets or sets the node/row item "selection" background brush. |
SelectionForegroundBrush | Gets or sets the node/row item "selection" foreground brush. |
TreeListViewColumn | Gets or sets the column object that will be rendered as a treelistview column - i.e. the column that will be able to expand/collapse its child nodes. |
TreeListViewColumnIndex | Gets or sets the column index that will be rendered as a treelistview column - i.e. the column that will be able to expand/collapse its child nodes. |
TreeListViewItemIsRenderedWithRoundedCorner | Gets or sets a value indicating whether the tree list view item is rendered with rounded corner. |
CollapseAllNodes | Collapses all nodes. |
ExpandAllNodes | Expands all nodes. |
ExpandNodeByIndex | Expands the index of the node by. |
ExpandNodesByIndices | Expands the nodes by indices. |
GetContainerForItemOverride | Creates the container that one item is shown in, which for this control is a BinaryTreeListViewItem. |
IsItemItsOwnContainerOverride | Reports whether an item can be shown as it stands, without being wrapped in a container of its own. |
OnItemsChanged | Raises the ItemsChanged event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior. |
SelectNodeByIndex | Selects the index of the node by. |
SelectNodesByIndices | Selects several nodes at once by their positions in the list. |
CollapseButtonImageProperty | Identifies the CollapseButtonImage dependency property. |
ExpandButtonImageProperty | Identifies the ExpandButtonImage dependency property. |
ExpandCollapseBorderBrushProperty | Identifies the ExpandCollapseBorderBrush dependency property. |
ExpandCollapseButtonImageStretchProperty | Identifies the ExpandCollapseButtonImageStretch dependency property. |
ExpandCollapseControlFillBrushProperty | Identifies the ExpandCollapseControlFillBrush dependency property. |
ExpandCollapsePlusMinusBrushProperty | Identifies the ExpandCollapsePlusMinusBrush dependency property. |
IsMultiSelectionEnabledProperty | Identifies the IsMultiSelectionEnabled dependency property. |
IsNodesConnectingLineVisibleProperty | Identifies the IsNodesConnectingLineVisible dependency property. |
IsShiftMultiSelectionEnabledProperty | Identifies the IsShiftMultiSelectionEnabled dependency property. |
NodesConnectingLineBrushProperty | Identifies the NodesConnectingLineBrush dependency property. |
RenderCollapseExpandVisualAlwaysInTheFirstColumnProperty | Identifies the RenderCollapseExpandVisualAlwaysInTheFirstColumn dependency property. |
SelectionBackgroundBrushProperty | Identifies the SelectionBackgroundBrush dependency property. |
SelectionForegroundBrushProperty | Identifies the SelectionForegroundBrush dependency property. |
TreeListViewColumnIndexProperty | Identifies the TreeListViewColumnIndex dependency property. |
TreeListViewColumnProperty | Identifies the TreeListViewColumn dependency property. |
TreeListViewItemIsRenderedWithRoundedCornerProperty | Identifies the TreeListViewItemIsRenderedWithRoundedCorner dependency property. |
Constructors
BinaryTreeListView
Initializes a new instance of the BinaryTreeListView class.
Properties
CollapseButtonImage
Gets or sets the collapse button image.
Columns
Gets the columns collection in the control.
ExpandButtonImage
Gets or sets the expand button image.
ExpandCollapseBorderBrush
Gets or sets the expand / collapse border brush.
ExpandCollapseButtonImageStretch
Gets or sets the expand collapse button image stretch.
Value. The expand collapse button image stretch.
ExpandCollapseControlFillBrush
Gets or sets the expand / collapse glyph fill brush.
ExpandCollapsePlusMinusBrush
Gets or sets the expand / collapse plus / minus brush.
IsMultiSelectionEnabled
Gets or sets whether multi-selection of notes is enabled.
IsShiftMultiSelectionEnabled to True.IsNodesConnectingLineVisible
Gets or sets a value indicating whether the control should draw the nodes connecting line.
IsShiftMultiSelectionEnabled
Gets or sets whether the SHIFT + selection is enabled for multi-selection of nodes. By default this value is false.
MultiSelectedItems
Gets the multi-selected items.
Value. The multi selected items.
NodesConnectingLineBrush
Gets or sets the nodes connecting line brush.
Value. The nodes connecting line brush.
RenderCollapseExpandVisualAlwaysInTheFirstColumn
Gets or sets a value indicating whether to always render the first column as the tree-list view colum.
SelectionBackgroundBrush
Gets or sets the node/row item "selection" background brush.
SelectionForegroundBrush
Gets or sets the node/row item "selection" foreground brush.
TreeListViewColumn
Gets or sets the column object that will be rendered as a treelistview column - i.e. the column that will be able to expand/collapse its child nodes.
Value. The tree list view column.
TreeListViewColumnIndex
Gets or sets the column index that will be rendered as a treelistview column - i.e. the column that will be able to expand/collapse its child nodes.
Value. The tree list view column.
TreeListViewItemIsRenderedWithRoundedCorner
Gets or sets a value indicating whether the tree list view item is rendered with rounded corner.
Methods
CollapseAllNodes
Collapses all nodes.
ExpandAllNodes
Expands all nodes.
- shouldScrollBackToTop
- if set to true the control should scroll back to the top item in the tree-listview instance.
ExpandNodeByIndex
Expands the index of the node by.
- index
- The index.
ExpandNodesByIndices
Expands the nodes by indices.
- indices
- The indices.
GetContainerForItemOverride
Creates the container that one item is shown in, which for this control is a BinaryTreeListViewItem.
IsItemItsOwnContainerOverride
Reports whether an item can be shown as it stands, without being wrapped in a container of its own.
OnItemsChanged
Raises the ItemsChanged event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
- e
- The data for the event.
SelectNodeByIndex
Selects the index of the node by.
- index
- The index.
SelectNodesByIndices
Selects several nodes at once by their positions in the list.
- indices
- The zero-based positions to select. An empty sequence selects nothing.
Fields
CollapseButtonImageProperty
Identifies the CollapseButtonImage dependency property.
ExpandButtonImageProperty
Identifies the ExpandButtonImage dependency property.
ExpandCollapseBorderBrushProperty
Identifies the ExpandCollapseBorderBrush dependency property.
ExpandCollapseButtonImageStretchProperty
Identifies the ExpandCollapseButtonImageStretch dependency property.
ExpandCollapseControlFillBrushProperty
Identifies the ExpandCollapseControlFillBrush dependency property.
ExpandCollapsePlusMinusBrushProperty
Identifies the ExpandCollapsePlusMinusBrush dependency property.
IsMultiSelectionEnabledProperty
Identifies the IsMultiSelectionEnabled dependency property.
IsNodesConnectingLineVisibleProperty
Identifies the IsNodesConnectingLineVisible dependency property.
IsShiftMultiSelectionEnabledProperty
Identifies the IsShiftMultiSelectionEnabled dependency property.
NodesConnectingLineBrushProperty
Identifies the NodesConnectingLineBrush dependency property.
RenderCollapseExpandVisualAlwaysInTheFirstColumnProperty
Identifies the RenderCollapseExpandVisualAlwaysInTheFirstColumn dependency property.
SelectionBackgroundBrushProperty
Identifies the SelectionBackgroundBrush dependency property.
SelectionForegroundBrushProperty
Identifies the SelectionForegroundBrush dependency property.
TreeListViewColumnIndexProperty
Identifies the TreeListViewColumnIndex dependency property.
TreeListViewColumnProperty
Identifies the TreeListViewColumn dependency property.
TreeListViewItemIsRenderedWithRoundedCornerProperty
Identifies the TreeListViewItemIsRenderedWithRoundedCorner dependency property.