BinaryTreeListViewCell
The cell of the tree column: a text cell that also draws the node's indent, connecting lines, expand glyph and image or check box, and turns clicks on them into tree actions.
public class BinaryTreeListViewCell : DataGridViewTextBoxCell
Inherits from / implements: DataGridViewTextBoxCell
Remarks
Every cell of a BinaryTreeListViewColumn is one of these; there is no need to
create them yourself. The cell is laid out from the left: one indent step (20 logical pixels) per
level, with the expand glyph in the last step; then the image, check box or radio button; then the
text, which edits like any text cell.
A click on the cell raises BinaryTreeListView.BinaryTreeListViewCellClicked,
saying which of those parts was clicked, before the control acts on it.
See also
Members at a glance
| Constructors | |
|---|---|
BinaryTreeListViewCell | Creates a tree cell. A BinaryTreeListViewColumn creates its cells itself. |
| Methods | |
OnKeyDown | Handles a key pressed while the cell has the focus: with
BinaryTreeListView.ExpandCollapsingOfNodesLevel set to
ExpandCollapsingOfNodesLevel.TreeListViewCell, Shift+Right opens the node and
Shift+Left closes it. |
OnLeave | Handles the focus leaving the cell, restoring the control's
BinaryTreeListView.CellEditingMode. |
OnMouseDown | Handles a mouse press on the cell: works out which part was pressed, raises
BinaryTreeListView.BinaryTreeListViewCellClicked, and then, unless a handler
cancelled it, opens or closes the node, changes its check box, or lets the press select the text. |
OnMouseUp | Handles the mouse button being released over the cell, ending the control's handling of the click. |
Paint | Paints the cell: its text, then the node's image or check box, the connecting lines and the expand glyph. |
Constructors
BinaryTreeListViewCell
Creates a tree cell. A BinaryTreeListViewColumn creates its cells itself.
Methods
OnKeyDown
Handles a key pressed while the cell has the focus: with
BinaryTreeListView.ExpandCollapsingOfNodesLevel set to
ExpandCollapsingOfNodesLevel.TreeListViewCell, Shift+Right opens the node and
Shift+Left closes it.
Parameters
e- The key that was pressed.
rowIndex- The row the cell is in.
OnLeave
Handles the focus leaving the cell, restoring the control's
BinaryTreeListView.CellEditingMode.
Parameters
rowIndex- The row the cell is in.
throughMouseClicktruewhen the focus moved because of a click.
OnMouseDown
Handles a mouse press on the cell: works out which part was pressed, raises
BinaryTreeListView.BinaryTreeListViewCellClicked, and then, unless a handler
cancelled it, opens or closes the node, changes its check box, or lets the press select the text.
Parameters
e- The data for the event.
Remarks
A press on the glyph, check box or image area never starts an edit, and ends one in progress when
BinaryTreeListView.EnableCommitingEditWhenMovingFocusFromEditContext is on.
OnMouseUp
Handles the mouse button being released over the cell, ending the control's handling of the click.
Parameters
e- The data for the event.
Paint
Paints the cell: its text, then the node's image or check box, the connecting lines and the expand glyph.
Remarks
A cell whose value is null is not painted at all – give every node a value in the
tree column.