HypernovaDesktop Components · docs
Binarymission
WinFormsTree List View › BinaryTreeListView

BinaryTreeListView

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WinForms.Controls.TreeControls

A list view style control that brings in conventional tree and list view styles into one control.

public class BinaryTreeListView : DataGridView

Inherits from / implements: DataGridView

Remarks

To get this control working for you, all you will need to do is these:
1. Instantiate the control.
2. Set up columns in the control, including one column that is of type BinaryTreeListViewColumn.
3. Set up any properties on the control, that you want it to have by default, like node image, line drawing color, etc.
4. Create instances of nodes (BinaryTreeListViewNode, by making a call to the control instance's Nodes.Add(...) method.
5. Create child nodes on each of these nodes you have created, as per your hierarchical data mode requirements.

That is all to it! You are ready to watch your hierarchical data in a tree-list view style view :-)

Members at a glance

BinaryTreeListViewConstructs a new instance of BinaryTreeListView class.
AllowDataErrorExceptionToBeThrownGets or sets whether the control should allow to flow data error exceptions.
AllowUserToAddRowsGets or sets a value indicating whether the option to add rows is displayed to the user.
AllowUserToDeleteRowsGets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.
AllowUserToSortColumnsGets or sets whether clicking a column header sorts the tree by that column: ascending, then descending, then back to the order the nodes were built in.
BuiltInCustomRenderedTargetElementGets or sets the target UI element (like column header cell, row header cell and row) that is to be custom drawn by the built-in renderer, by using the color properties.
BusyIndicatorTextGets or sets the busy indicator text.
BusyIndicatorTextBackColorGets or sets the backcolor of the busy indicator text.
BusyIndicatorTextFontGets or sets the font for the busy indicator text.
BusyIndicatorTextForeColorGets or sets the forecolor of the busy indicator text.
CellBorderColorGets or sets the color of the cell border.
CellBorderDrawingColorGets or sets the color for drawing the cell border, when the UseBuiltInRendering property is switched on, with option set to draw either Column headers or All.
CellBorderWidthGets or sets the width of the cell border.
CellEditingModeCustom implementation of the EditMode property.
CollapseImageGets or sets the image to be used to draw the "collapse" state of the node.
ColumnBackgroundDefaultCellStyleBackColorGets or sets the color of the column background default cell style back.
ColumnBackgroundOnCellSelectionColorGets or sets the color of the column background when a cell is selected.
ColumnBackgroundOnMouseHoverColorGets or sets the color of the column background on mouse hover.
ColumnHeaderBottomBorderColorGets or sets the colour of a hairline drawn along the bottom of the column headers, when the UseBuiltInRendering property is switched on with the option set to draw either column headers or all. Empty, the default, draws none.
ColumnSeparatorDrawingColorGets or sets the color for drawing the column separator, when the UseBuiltInRendering property is switched on, with option set to draw either Column headers or All.
ControlDataDisplayModeGets or sets whether to run the control in its tree-list or list-view mode.
CurrentNodeReturns the current active node in the control.
DepthForPreparingNodesWithChildrenGets or sets as to how many nested levels of depth the control should read data and build nodes with its children.
DrawColumnSeparatorWhenUsingBuiltinRendering
DrawGlassBackgroundHighlightingOnMouseEnterGets or sets a value indicating whether to draw "glass" background highlighting on mouse entering a row.
DrawNodeConnectingLinesGets or sets whether to draw the lines to show connections between the nodes.
EnableAutomaticBuiltInDragDropGets or sets a value indicating whether the control should enable the automatic custom built-in drag and drop feature for tree-list nodes within the control.
EnableCommitingEditWhenMovingFocusFromEditContextGets or sets whether the control should commit any user edits in the node, when the user clicks on the other areas in the same cell - i.e. when he clicks on the image area or the expand/collapse area in the BinaryTreeListViewCell instance.
EnableExpandCollapsingOfNodesUponMouseClickOnReadOnlyTreeListViewNodeCellOrColumnGets or sets whether to enable expand/collapse of nodes (that have children) when the user clicks on the node/cell when their ReadOnly property is true.
EndColorForRenderingColumnHeaderGets or sets the end color for rendering the column header.
EndColorForRenderingRowGets or sets the end color for rendering the row.
EndColorForRenderingRowHeaderGets or sets the end color for rendering the row header.
ExpandCollapseNodeOnDoubleClickGets or sets whether double-clicking a node's cell in the tree column expands or collapses it. The expand glyph toggles on a single click either way. The default is true.
ExpandCollapsingOfNodesLevelGets or sets the level at which the keyboard based nodes expanding/collapsing functionality is to work.
ExpandImageGets or sets the image to be used to draw the "expand" state of the node.
ExpandTargetDropNodeUponDragDropGets oir sets whether the control should expand all nodes in the target node location upon drag/drop drop action completing.
FrameBorderColorGets or sets the colour of the frame's border (see ShouldDrawFrame).
FrameBorderThicknessGets or sets the thickness of the frame's border, in logical (96 DPI) pixels, 0 to 8.
FrameCornerRadiusGets or sets the radius of the frame's corners, in logical (96 DPI) pixels, 0 to 32.
FrameFocusedBorderColorGets or sets the colour of the frame's border while the focus is in the control - on the grid or on a cell's editor. Empty keeps FrameBorderColor.
FramePaddingGets or sets the space between the frame's border and the grid, in logical (96 DPI) pixels, 0 to 16. It is never less than the corners need to keep the grid inside them.
FrameShadowColorGets or sets the colour of the frame's drop shadow. Its strength is FrameShadowOpacity, so the colour's own alpha is not used.
FrameShadowDepthGets or sets how far the frame's shadow spreads, in logical (96 DPI) pixels, 0 to 24. A third of it is also the distance the shadow drops below the frame.
FrameShadowOpacityGets or sets the strength of the frame's shadow at its darkest, as a percentage, 0 to 100.
GlassBrushBottomHalfEndColorGets or sets the end color of the glass brush (bottom half area).
GlassBrushBottomHalfStartColorGets or sets the start color of the glass brush (bottom half area).
GlassBrushLinearGradientFactorGets or sets the glass brush linear gradient factor.
GlassBrushTopHalfEndColorGets or sets the end color of the glass brush (top half area).
GlassBrushTopHalfStartColorGets or sets the start color of the glass brush (top half area).
HierarchicalDataSourceGets or sets a data source object for data-binding to the tree-list view.
HighlightOnlyTreeListCellDuringDragOverGets or sets the value as to whether to change the colors for background and/or foregroun for the entire row or just only the tree-cell, when the user is performing a drag & drop operation.
IsChildDropDownShowingGets or sets whether the current column that is of type BinaryTreeListViewDatePickerColumn has the date picker editor control's dropdown calender window is currently showing/displaying.
LineDrawingColorGets or sets the color for drawing the "nodes connecting" lines.
LineDrawingDashStyleGets or sets the drawing style to be used to draw the "nodes connecting" lines.
NodeImageGets or sets the Image for all node instances in this control.
NodesGets the nodes in the control's nodes collection.
NodesSortColumnGets the column the nodes are sorted by, or null when they are in the order they were built in.
NodesSortDirectionGets the direction the nodes are sorted in, or None.
NodesSortOrderGets or sets the nodes sort order.
OptimiseLayoutRenderingDuringDragDropGets or sets whether to run an optimisation for layout adjustments during drag/drop action.
OrientationAspectForRenderingColumnHeaderGets or sets the orientation aspect for rendering column header.
OrientationAspectForRenderingRowGets or sets the orientation aspect for rendering row.
OrientationAspectForRenderingRowHeaderGets or sets the orientation aspect for rendering row header.
RowSelectionBackColorDuringDragOverGets or sets the row/cell selection backcolor when the user is performing a drag & drop operation.
RowSelectionForeColorDuringDragOverGets or sets the row/cell selection forecolor when the user is performing a drag & drop operation.
RowTemplateCustom implementation of RowTemplate property.
RowsCustom implementation of Rows property.
ShouldDrawCellBorderWhenSelectedGets or sets a value indicating whether the control should draw cell border when the cell is selected.
ShouldDrawColumnBackgroundUponCellSelectionGets or sets a value indicating whether the control should draw column background upon selecting a cell.
ShouldDrawColumnBackgroundUponMouseHoveringGets or sets a value indicating whether the control should draw column background upon mouse hovering.
ShouldDrawFrameGets or sets a value indicating whether the control draws its own frame: a border with rounded corners, an inner padding and, optionally, a drop shadow, all inside its bounds.
ShouldDrawFrameShadowGets or sets a value indicating whether the frame casts a soft drop shadow.
ShouldEnableFastCachingGets or sets a value indicating whether the control should enable fast caching.
ShouldEnableLinkedRelationshipsTuningGets or sets a value indicating whether the control should perform linked relationships tuning.
ShowNodeImageGets or sets whether to show the associated node image NodeImage for each of the node instances in this control's instance.
SpecialColumnCellsToDisplayEditingControlOnCellsAlwaysGets or sets whether the special column cells (i.e. BinaryDatePicker column, BinaryComboBox column, etc.) should draw the editing control on the cell even when the cell is not in editing mode.
StartColorForRenderingColumnHeaderGets or sets the start color for rendering the column header.
StartColorForRenderingRowGets or sets the start color for rendering the row.
StartColorForRenderingRowHeaderGets or sets the start color for rendering the row header.
UseBuiltInRenderingGets or sets whether to use built-in custom rendering for painting a desired target UI element in the control.
VirtualModeWhether the grid asks for cell values as it needs them rather than holding them. Hidden from the base so that setting it repaints, which the inherited property does not do.
AboutShows the component's about box. It is here for the design-time verb and is not meant to be called from an application.
BindToTreeListViewDeterministically data binds the control (when in treelistmode) to a data source object.
ClearAllNodesClears all nodes in the control.
CollapseAllNodesCollapses all the nodes in the control.
CollapseNodeExpands the given node and all its children.
CollapseNodeA helper method to enable collapsing a given node, if the given node is in expanded state.
DisposeReleases the resources held by this BinaryTreeListView.
ExpandAllNodesExpands all nodes in the control.
ExpandNodeExpands the given node and all its children.
ExpandNodeHelper method to perform expansion of a node, if that node contains any child nodes in it, and if it is not already in expanded state.
GetAllSiblingsForThisNodeGets a list if BinaryTreeListViewNode sibling objects, given a BinaryTreeListView object node.
GetFlatListOfNodesReturns a flat list of all nodes in the control.
GetFlatListOfNodesGets a flattened collection of all child nodes for a given node.
GetNodeAtReturns the tree node at the client point supplied.
OnCellMouseDoubleClickRaises the CellMouseDoubleClick event, and expands or collapses the node when ExpandCollapseNodeOnDoubleClick is on and the cell is in the tree column.
OnCellMouseDownRaises the CellMouseDown event, noting where a pressed column header stood, so a header that is dragged to a new place is not also taken as a click to sort.
OnCellMouseEnterRaises the CellMouseEnter event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
OnCellMouseLeaveRaises the CellMouseLeave event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
OnCellPaintingOverrides the base implementation.
OnColumnAddedRaises the ColumnAdded event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
OnColumnHeaderMouseClickRaises the ColumnHeaderMouseClick event, and sorts by the column when AllowUserToSortColumns is on.
OnColumnWidthChangedOverrides the base implementation.
OnDataErrorCalled when a cell cannot format or commit its value. The grid can be told to let the exception out rather than showing its own dialog, which is what an application that does its own validation wants.
OnHandleCreatedRaises the HandleCreated event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
OnKeyDownRaises the KeyDown event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
OnMouseDownRaises the MouseDown event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
OnMouseLeaveRaises the MouseLeave event, clearing any hover highlight.
OnMouseMoveRaises the MouseMove event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
OnMouseUpRaises the MouseUp event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
OnParentChangedRaises the ParentChanged event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
OnRowEnterRaises the RowEnter event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
OnRowsAddedRaises the RowsAdded event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
OnSizeChangedRaises the SizeChanged event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.
SetUpNodeControlTypeSets up the node control type for all nodes in the control - i.e. whether to set it up to support Image (default), radio button or the checkbox control.
SortNodesByColumnSorts the nodes by the values in a column - siblings within their parent, at every level, collapsed ones included - or, with None, puts back the order they were built in.
WndProcProcesses the Windows messages sent to this control's window.
BinaryTreeListViewCellClickedAn event raised when a tree cell BinaryTreeListViewCell is clicked by the user.
BinaryTreeListViewNodeCollapsedAn event raised when a node in the BinaryTreeListView control, has collapsed.
BinaryTreeListViewNodeCollapsingAn event raised when a node in the BinaryTreeListView control, is about to collapse.
BinaryTreeListViewNodeExpandedAn event raised when a node in the BinaryTreeListView control, has expanded.
BinaryTreeListViewNodeExpandingAn event raised when a node in the BinaryTreeListView control, is about to expand.
ItemDragOccurs when the user begins dragging a BinaryTreeListViewNode instance, and the property AllowDrop is set to true.

Constructors

BinaryTreeListView

public BinaryTreeListView()

Constructs a new instance of BinaryTreeListView class.

Properties

AllowDataErrorExceptionToBeThrown

public bool AllowDataErrorExceptionToBeThrown

Gets or sets whether the control should allow to flow data error exceptions.

The default value is false.

AllowUserToAddRows

public new bool AllowUserToAddRows

Gets or sets a value indicating whether the option to add rows is displayed to the user.

AllowUserToDeleteRows

public new bool AllowUserToDeleteRows

Gets or sets a value indicating whether the user is allowed to delete rows from the DataGridView.

AllowUserToSortColumns

public bool AllowUserToSortColumns

Gets or sets whether clicking a column header sorts the tree by that column: ascending, then descending, then back to the order the nodes were built in.

A plain row sort would scramble a tree, so this is not DataGridView's own sort - every column stays NotSortable. Siblings are sorted within their parent, at every level, and each parent keeps its children beneath it. Handle SortCompare to compare two values yourself, as for a DataGridView's own sort. To sort from code, call SortNodesByColumn. The default is false.

BuiltInCustomRenderedTargetElement

public BuiltInCustomRenderedTargetElement BuiltInCustomRenderedTargetElement

Gets or sets the target UI element (like column header cell, row header cell and row) that is to be custom drawn by the built-in renderer, by using the color properties.

Use this property along with the other associated properties like: UseBuiltInRendering OrientationAspectForRenderingColumnHeader OrientationAspectForRenderingRowHeader OrientationAspectForRenderingRow StartColorForRenderingColumnHeader EndColorForRenderingColumnHeader StartColorForRenderingRowHeader EndColorForRenderingRowHeader StartColorForRenderingRow EndColorForRenderingRow

BusyIndicatorText

public string BusyIndicatorText

Gets or sets the busy indicator text.

BusyIndicatorTextBackColor

public Color BusyIndicatorTextBackColor

Gets or sets the backcolor of the busy indicator text.

BusyIndicatorTextFont

public Font BusyIndicatorTextFont

Gets or sets the font for the busy indicator text.

BusyIndicatorTextForeColor

public Color BusyIndicatorTextForeColor

Gets or sets the forecolor of the busy indicator text.

CellBorderColor

public Color CellBorderColor

Gets or sets the color of the cell border.

CellBorderDrawingColor

public Color CellBorderDrawingColor

Gets or sets the color for drawing the cell border, when the UseBuiltInRendering property is switched on, with option set to draw either Column headers or All.

Note that when using the built in custom rendering, only the following CellBorderStyle values are supported: 1. Single
2. SingleVertical
3.SingleHorizontal

CellBorderWidth

public int CellBorderWidth

Gets or sets the width of the cell border.

CellEditingMode

public DataGridViewEditMode CellEditingMode

Custom implementation of the EditMode property.

Please use this property to set up the value that you would otherwise set up using EditMode property directly.
The control performs some custom validation, etc. and hence needs to hide the base property.

CollapseImage

public Image CollapseImage

Gets or sets the image to be used to draw the "collapse" state of the node.

ColumnBackgroundDefaultCellStyleBackColor

public Color ColumnBackgroundDefaultCellStyleBackColor

Gets or sets the color of the column background default cell style back.

ColumnBackgroundOnCellSelectionColor

public Color ColumnBackgroundOnCellSelectionColor

Gets or sets the color of the column background when a cell is selected.

ColumnBackgroundOnMouseHoverColor

public Color ColumnBackgroundOnMouseHoverColor

Gets or sets the color of the column background on mouse hover.

ColumnHeaderBottomBorderColor

public Color ColumnHeaderBottomBorderColor

Gets or sets the colour of a hairline drawn along the bottom of the column headers, when the UseBuiltInRendering property is switched on with the option set to draw either column headers or all. Empty, the default, draws none.

The rule that parts a header from the rows without a bevel. The built-in header renderer paints its own background over the grid's header border, so without this the header's lower edge is wherever its colour stops (HANDOVER 3av). The line is one logical pixel thick.

ColumnSeparatorDrawingColor

public Color ColumnSeparatorDrawingColor

Gets or sets the color for drawing the column separator, when the UseBuiltInRendering property is switched on, with option set to draw either Column headers or All.

ControlDataDisplayMode

public ControlDataDisplayMode ControlDataDisplayMode

Gets or sets whether to run the control in its tree-list or list-view mode.

CurrentNode

public BinaryTreeListViewNode CurrentNode

Returns the current active node in the control.

DepthForPreparingNodesWithChildren

public int DepthForPreparingNodesWithChildren

Gets or sets as to how many nested levels of depth the control should read data and build nodes with its children.

The default value is 25.

DrawColumnSeparatorWhenUsingBuiltinRendering

public bool DrawColumnSeparatorWhenUsingBuiltinRendering

No summary in the source yet.

Also refer to properties:
UseBuiltInRendering BuiltInCustomRenderedTargetElement

DrawGlassBackgroundHighlightingOnMouseEnter

public bool DrawGlassBackgroundHighlightingOnMouseEnter

Gets or sets a value indicating whether to draw "glass" background highlighting on mouse entering a row.

DrawNodeConnectingLines

public bool DrawNodeConnectingLines

Gets or sets whether to draw the lines to show connections between the nodes.

EnableAutomaticBuiltInDragDrop

public bool EnableAutomaticBuiltInDragDrop

Gets or sets a value indicating whether the control should enable the automatic custom built-in drag and drop feature for tree-list nodes within the control.

EnableCommitingEditWhenMovingFocusFromEditContext

public bool EnableCommitingEditWhenMovingFocusFromEditContext

Gets or sets whether the control should commit any user edits in the node, when the user clicks on the other areas in the same cell - i.e. when he clicks on the image area or the expand/collapse area in the BinaryTreeListViewCell instance.

EnableExpandCollapsingOfNodesUponMouseClickOnReadOnlyTreeListViewNodeCellOrColumn

public bool EnableExpandCollapsingOfNodesUponMouseClickOnReadOnlyTreeListViewNodeCellOrColumn

Gets or sets whether to enable expand/collapse of nodes (that have children) when the user clicks on the node/cell when their ReadOnly property is true.

EndColorForRenderingColumnHeader

public Color EndColorForRenderingColumnHeader

Gets or sets the end color for rendering the column header.

EndColorForRenderingRow

public Color EndColorForRenderingRow

Gets or sets the end color for rendering the row.

EndColorForRenderingRowHeader

public Color EndColorForRenderingRowHeader

Gets or sets the end color for rendering the row header.

ExpandCollapseNodeOnDoubleClick

public bool ExpandCollapseNodeOnDoubleClick

Gets or sets whether double-clicking a node's cell in the tree column expands or collapses it. The expand glyph toggles on a single click either way. The default is true.

ExpandCollapsingOfNodesLevel

public ExpandCollapsingOfNodesLevel ExpandCollapsingOfNodesLevel

Gets or sets the level at which the keyboard based nodes expanding/collapsing functionality is to work.

The control can support two levels - i.e. Row or Cell (i.e. BinaryTreeListViewCell level.
If set as Row, then if the user hits Shift + Right or Shift + Left keys when he is focused on a row/node, the treelistview node will expand or collapse respectively.
If set as TreeListViewCell, the user will have to specifically keep the focus on the treelistview cell, and then hit keys Shift + Left / Right to collapse / expand respectively.

ExpandImage

public Image ExpandImage

Gets or sets the image to be used to draw the "expand" state of the node.

ExpandTargetDropNodeUponDragDrop

public bool ExpandTargetDropNodeUponDragDrop

Gets oir sets whether the control should expand all nodes in the target node location upon drag/drop drop action completing.

FrameBorderColor

public Color FrameBorderColor

Gets or sets the colour of the frame's border (see ShouldDrawFrame).

FrameBorderThickness

public int FrameBorderThickness

Gets or sets the thickness of the frame's border, in logical (96 DPI) pixels, 0 to 8.

FrameCornerRadius

public int FrameCornerRadius

Gets or sets the radius of the frame's corners, in logical (96 DPI) pixels, 0 to 32.

FrameFocusedBorderColor

public Color FrameFocusedBorderColor

Gets or sets the colour of the frame's border while the focus is in the control - on the grid or on a cell's editor. Empty keeps FrameBorderColor.

FramePadding

public int FramePadding

Gets or sets the space between the frame's border and the grid, in logical (96 DPI) pixels, 0 to 16. It is never less than the corners need to keep the grid inside them.

FrameShadowColor

public Color FrameShadowColor

Gets or sets the colour of the frame's drop shadow. Its strength is FrameShadowOpacity, so the colour's own alpha is not used.

FrameShadowDepth

public int FrameShadowDepth

Gets or sets how far the frame's shadow spreads, in logical (96 DPI) pixels, 0 to 24. A third of it is also the distance the shadow drops below the frame.

FrameShadowOpacity

public int FrameShadowOpacity

Gets or sets the strength of the frame's shadow at its darkest, as a percentage, 0 to 100.

GlassBrushBottomHalfEndColor

public Color GlassBrushBottomHalfEndColor

Gets or sets the end color of the glass brush (bottom half area).

GlassBrushBottomHalfStartColor

public Color GlassBrushBottomHalfStartColor

Gets or sets the start color of the glass brush (bottom half area).

GlassBrushLinearGradientFactor

public float GlassBrushLinearGradientFactor

Gets or sets the glass brush linear gradient factor.

Value. The glass brush linear gradient factor.

GlassBrushTopHalfEndColor

public Color GlassBrushTopHalfEndColor

Gets or sets the end color of the glass brush (top half area).

GlassBrushTopHalfStartColor

public Color GlassBrushTopHalfStartColor

Gets or sets the start color of the glass brush (top half area).

HierarchicalDataSource

public object HierarchicalDataSource

Gets or sets a data source object for data-binding to the tree-list view.

The control in its TreeListView mode only supports either a DataTable or DataView instance as the data source, when it is used in data-bound mode.
Note that the control in its ListView/Grid mode supports many data sources.

The DataTable / DataView schema the control expects, for this feature to work is like so:

Technical detail:

There are three specific columns that need to be there in your data source, before your normal data columns appear viz.,
UID, ID, ParentID, [Your data Column1],... , [your data Column n]

The first three specific columns of data are for the purposes of the control, for it to prepare the hierarchical layout of nodes.

The specifics of these columns are like so:

UID : This is the unique ID that every single record in the data-table will have - i.e. these are IDs assigned to each node, so it will be unique across the entire tree.

ID : This is the unique ID that every single record will have have in a given tree node level -i.e. these are Unique IDs across the sibling rows within a particular level of node.

Note here how ID is different to the UID for the same node. UID makes it unique across the entire tree, but ID makes the node unique across the sibling nodes in a given node level.

This column (ID) is for future features support purposes.

Note that if you do not set the ID for a given node, it is not an issue. BUT, please add that column in your data-table, even if you don't set any value for that column for the rows (nodes for the control).

ParentID : This is the UID of the node which is the parent of a given child node. If a node does not have any parent node - i.e it is the/a top level node, then its ParentID will have to be set to -1.

Note: Please also refer to the sample DataBoundBinaryTreeListViewDemo sample project for the sample source code of this property in action.

HighlightOnlyTreeListCellDuringDragOver

public bool HighlightOnlyTreeListCellDuringDragOver

Gets or sets the value as to whether to change the colors for background and/or foregroun for the entire row or just only the tree-cell, when the user is performing a drag & drop operation.

IsChildDropDownShowing

public bool IsChildDropDownShowing

Gets or sets whether the current column that is of type BinaryTreeListViewDatePickerColumn has the date picker editor control's dropdown calender window is currently showing/displaying.

LineDrawingColor

public Color LineDrawingColor

Gets or sets the color for drawing the "nodes connecting" lines.

LineDrawingDashStyle

public System.Drawing.Drawing2D.DashStyle LineDrawingDashStyle

Gets or sets the drawing style to be used to draw the "nodes connecting" lines.

NodeImage

public Image NodeImage

Gets or sets the Image for all node instances in this control.

Note that you can also set an image that is applicable on a "per node" basis, by using the Image property.

Nodes

public BinaryTreeListViewNodesCollection Nodes

Gets the nodes in the control's nodes collection.

This is the property that you will need to use, to add node(s) into the control.
For more information of this property's usage, please refer to an example here: BinaryTreeListViewNodesCollection.Add(params object [])

NodesSortColumn

public DataGridViewColumn NodesSortColumn

Gets the column the nodes are sorted by, or null when they are in the order they were built in.

NodesSortDirection

public SortOrder NodesSortDirection

Gets the direction the nodes are sorted in, or None.

NodesSortOrder

public NodeSortOrder NodesSortOrder

Gets or sets the nodes sort order.

Value. The nodes sort order.

OptimiseLayoutRenderingDuringDragDrop

public bool OptimiseLayoutRenderingDuringDragDrop

Gets or sets whether to run an optimisation for layout adjustments during drag/drop action.

OrientationAspectForRenderingColumnHeader

public LinearGradientMode OrientationAspectForRenderingColumnHeader

Gets or sets the orientation aspect for rendering column header.

OrientationAspectForRenderingRow

public LinearGradientMode OrientationAspectForRenderingRow

Gets or sets the orientation aspect for rendering row.

OrientationAspectForRenderingRowHeader

public LinearGradientMode OrientationAspectForRenderingRowHeader

Gets or sets the orientation aspect for rendering row header.

RowSelectionBackColorDuringDragOver

public Color RowSelectionBackColorDuringDragOver

Gets or sets the row/cell selection backcolor when the user is performing a drag & drop operation.

RowSelectionForeColorDuringDragOver

public Color RowSelectionForeColorDuringDragOver

Gets or sets the row/cell selection forecolor when the user is performing a drag & drop operation.

RowTemplate

public new DataGridViewRow RowTemplate

Custom implementation of RowTemplate property.

Rows

public new DataGridViewRowCollection Rows

Custom implementation of Rows property.

ShouldDrawCellBorderWhenSelected

public bool ShouldDrawCellBorderWhenSelected

Gets or sets a value indicating whether the control should draw cell border when the cell is selected.

ShouldDrawColumnBackgroundUponCellSelection

public bool ShouldDrawColumnBackgroundUponCellSelection

Gets or sets a value indicating whether the control should draw column background upon selecting a cell.

The tint follows the column of the current cell. In the tree-list mode, where a click selects the whole row, that is the column that was clicked - and, before anything has been clicked, the first column, since the grid makes the first cell current when it is filled.

ShouldDrawColumnBackgroundUponMouseHovering

public bool ShouldDrawColumnBackgroundUponMouseHovering

Gets or sets a value indicating whether the control should draw column background upon mouse hovering.

ShouldDrawFrame

public bool ShouldDrawFrame

Gets or sets a value indicating whether the control draws its own frame: a border with rounded corners, an inner padding and, optionally, a drop shadow, all inside its bounds.

The frame replaces BorderStyle: switching it on sets that to None, and switching it off puts back what it was. It is painted in the control's own non-client area, so the headers, the rows, the scroll bars and the hit testing all sit inside it. Outside the border - the shadow and the rounded corners - the control paints the background colour of the nearest parent that has an opaque one. Inside it, the padding is BackgroundColor, the colour of the grid below its last row.

ShouldDrawFrameShadow

public bool ShouldDrawFrameShadow

Gets or sets a value indicating whether the frame casts a soft drop shadow.

ShouldEnableFastCaching

public bool ShouldEnableFastCaching

Gets or sets a value indicating whether the control should enable fast caching.

ShouldEnableLinkedRelationshipsTuning

public bool ShouldEnableLinkedRelationshipsTuning

Gets or sets a value indicating whether the control should perform linked relationships tuning.

ShowNodeImage

public bool ShowNodeImage

Gets or sets whether to show the associated node image NodeImage for each of the node instances in this control's instance.

SpecialColumnCellsToDisplayEditingControlOnCellsAlways

public bool SpecialColumnCellsToDisplayEditingControlOnCellsAlways

Gets or sets whether the special column cells (i.e. BinaryDatePicker column, BinaryComboBox column, etc.) should draw the editing control on the cell even when the cell is not in editing mode.

StartColorForRenderingColumnHeader

public Color StartColorForRenderingColumnHeader

Gets or sets the start color for rendering the column header.

StartColorForRenderingRow

public Color StartColorForRenderingRow

Gets or sets the start color for rendering the row.

StartColorForRenderingRowHeader

public Color StartColorForRenderingRowHeader

Gets or sets the start color for rendering the row header.

UseBuiltInRendering

public bool UseBuiltInRendering

Gets or sets whether to use built-in custom rendering for painting a desired target UI element in the control.

For a list of all supported custom rendered UI elements, refer to BuiltInCustomRenderedTargetElement.

VirtualMode

public new bool VirtualMode

Whether the grid asks for cell values as it needs them rather than holding them. Hidden from the base so that setting it repaints, which the inherited property does not do.

Methods

About

public void About()

Shows the component's about box. It is here for the design-time verb and is not meant to be called from an application.

BindToTreeListView

public void BindToTreeListView(object dataSource, int depth)

Deterministically data binds the control (when in treelistmode) to a data source object.

dataSource
A DataTable or DataView instance.
depth
Lets you specify to the control as to what depth of nesting, the control should keep the nodes prepared with its children nodes. The default is 25.

ClearAllNodes

public void ClearAllNodes()

Clears all nodes in the control.

CollapseAllNodes

public void CollapseAllNodes()

Collapses all the nodes in the control.

CollapseNode

public bool CollapseNode(BinaryTreeListViewNode startNodeToCollapse, bool performDeepCollapse)

Expands the given node and all its children.

CollapseNode

public bool CollapseNode(BinaryTreeListViewNode binaryTreeListViewNode)

A helper method to enable collapsing a given node, if the given node is in expanded state.

binaryTreeListViewNode

Dispose

protected override void Dispose(bool disposing)

Releases the resources held by this BinaryTreeListView.

disposing
true when called from Dispose; false when called from the finalizer.

ExpandAllNodes

public void ExpandAllNodes()

Expands all nodes in the control.

ExpandNode

public bool ExpandNode(BinaryTreeListViewNode startNodeToExpand, bool performDeepExpansion)

Expands the given node and all its children.

startNodeToExpand
performDeepExpansion

ExpandNode

public bool ExpandNode(BinaryTreeListViewNode binaryTreeListViewNode)

Helper method to perform expansion of a node, if that node contains any child nodes in it, and if it is not already in expanded state.

binaryTreeListViewNode

GetAllSiblingsForThisNode

public IList<BinaryTreeListViewNode> GetAllSiblingsForThisNode(BinaryTreeListViewNode node, bool excludeThisNode)

Gets a list if BinaryTreeListViewNode sibling objects, given a BinaryTreeListView object node.

node
The node whose siblings are to be retrieved.
excludeThisNode
If true, the siblings list returned will not inlcude the passed in node (as is in the parameter/argument), otherwise it will.

GetFlatListOfNodes

public IEnumerable<BinaryTreeListViewNode> FlattenedNodes

Returns a flat list of all nodes in the control.

GetFlatListOfNodes

public IEnumerable<BinaryTreeListViewNode> GetFlatListOfNodes(BinaryTreeListViewNode startNodeWhoseChildrenCollectionAreNeededInTheList)

Gets a flattened collection of all child nodes for a given node.

startNodeWhoseChildrenCollectionAreNeededInTheList

GetNodeAt

public BinaryTreeListViewNode GetNodeAt(Point clientPoint)

Returns the tree node at the client point supplied.

clientPoint

OnCellMouseDoubleClick

protected override void OnCellMouseDoubleClick(DataGridViewCellMouseEventArgs e)

Raises the CellMouseDoubleClick event, and expands or collapses the node when ExpandCollapseNodeOnDoubleClick is on and the cell is in the tree column.

e
The data for the event.

OnCellMouseDown

protected override void OnCellMouseDown(DataGridViewCellMouseEventArgs e)

Raises the CellMouseDown event, noting where a pressed column header stood, so a header that is dragged to a new place is not also taken as a click to sort.

e
The data for the event.

OnCellMouseEnter

protected override void OnCellMouseEnter(DataGridViewCellEventArgs e)

Raises the CellMouseEnter event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnCellMouseLeave

protected override void OnCellMouseLeave(DataGridViewCellEventArgs e)

Raises the CellMouseLeave event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnCellPainting

protected override void OnCellPainting(DataGridViewCellPaintingEventArgs e)

Overrides the base implementation.

e

OnColumnAdded

protected override void OnColumnAdded(DataGridViewColumnEventArgs e)

Raises the ColumnAdded event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnColumnHeaderMouseClick

protected override void OnColumnHeaderMouseClick(DataGridViewCellMouseEventArgs e)

Raises the ColumnHeaderMouseClick event, and sorts by the column when AllowUserToSortColumns is on.

e
The data for the event.
The sort is done before the event is raised, so a handler sees the new order.

OnColumnWidthChanged

protected override void OnColumnWidthChanged(DataGridViewColumnEventArgs e)

Overrides the base implementation.

e

OnDataError

protected override void OnDataError(bool displayErrorDialogIfNoHandler, DataGridViewDataErrorEventArgs e)

Called when a cell cannot format or commit its value. The grid can be told to let the exception out rather than showing its own dialog, which is what an application that does its own validation wants.

displayErrorDialogIfNoHandler
true to show the built-in dialog when nothing handles the error.
e
What went wrong, and on which cell.

OnHandleCreated

protected override void OnHandleCreated(EventArgs e)

Raises the HandleCreated event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnKeyDown

protected override void OnKeyDown(KeyEventArgs e)

Raises the KeyDown event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnMouseDown

protected override void OnMouseDown(MouseEventArgs e)

Raises the MouseDown event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnMouseLeave

protected override void OnMouseLeave(EventArgs e)

Raises the MouseLeave event, clearing any hover highlight.

e
The data for the event.
CellMouseLeave covers moving from one cell to another, but the pointer can leave the grid by a route that raises no cell event at all - across the border, or with the window losing capture - and the highlight would stay on a row the pointer had left.

OnMouseMove

protected override void OnMouseMove(MouseEventArgs e)

Raises the MouseMove event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnMouseUp

protected override void OnMouseUp(MouseEventArgs e)

Raises the MouseUp event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnParentChanged

protected override void OnParentChanged(EventArgs e)

Raises the ParentChanged event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnRowEnter

protected override void OnRowEnter(DataGridViewCellEventArgs e)

Raises the RowEnter event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnRowsAdded

protected override void OnRowsAdded(DataGridViewRowsAddedEventArgs e)

Raises the RowsAdded event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

OnSizeChanged

protected override void OnSizeChanged(EventArgs e)

Raises the SizeChanged event. BinaryTreeListView overrides it so the control's own handling runs alongside the base behavior.

e
The data for the event.

SetUpNodeControlType

public void SetUpNodeControlType(NodeControlType controlType)

Sets up the node control type for all nodes in the control - i.e. whether to set it up to support Image (default), radio button or the checkbox control.

controlType

SortNodesByColumn

public void SortNodesByColumn(DataGridViewColumn column, SortOrder order)

Sorts the nodes by the values in a column - siblings within their parent, at every level, collapsed ones included - or, with None, puts back the order they were built in.

column
A column of this control.
order
Ascending, Descending, or None for the original order.
Values of the same comparable type - numbers, dates, strings - compare as that type; anything else compares by its text in the current culture. Handle SortCompare to decide a comparison yourself: the row indices it is given are -1 for a node that is not on screen because its parent is collapsed. Nodes added after a sort are not placed by it; sort again to include them.

WndProc

protected override void WndProc(ref Message m)

Processes the Windows messages sent to this control's window.

The frame's ring is taken off the window before the grid lays its headers, rows and scroll bars out in what is left, and painted after the default non-client painting.

Events

BinaryTreeListViewCellClicked

public event BinaryTreeListViewCellClickedHandler BinaryTreeListViewCellClicked

An event raised when a tree cell BinaryTreeListViewCell is clicked by the user.

BinaryTreeListViewNodeCollapsed

public event BinaryTreeListViewNodeCollapsedEventHandler BinaryTreeListViewNodeCollapsed

An event raised when a node in the BinaryTreeListView control, has collapsed.

BinaryTreeListViewNodeCollapsing

public event BinaryTreeListViewNodeCollapsingEventHandler BinaryTreeListViewNodeCollapsing

An event raised when a node in the BinaryTreeListView control, is about to collapse.

BinaryTreeListViewNodeExpanded

public event BinaryTreeListViewNodeExpandedEventHandler BinaryTreeListViewNodeExpanded

An event raised when a node in the BinaryTreeListView control, has expanded.

BinaryTreeListViewNodeExpanding

public event BinaryTreeListViewNodeExpandingEventHandler BinaryTreeListViewNodeExpanding

An event raised when a node in the BinaryTreeListView control, is about to expand.

ItemDrag

public event ItemDragEventHandler ItemDrag

Occurs when the user begins dragging a BinaryTreeListViewNode instance, and the property AllowDrop is set to true.