Flexible TreeView Flexible TreeView


Support & Community

NodeExpandableTextBox node control

Previous Table of Contents Next
NodeExpandableTextBox allows you to show a text title if a node isn`t selected, focused, or under the mouse cursor, and the title and additional text description if the node is selected, focused, or under the mouse cursor. This allows you to not overload the treeview with information, to be intuitive and understandable, while at the same time to provide more information on the selected node.


Note that the Options.Node.AutoNodeHeight treeview option must be enabled to show an expandable node control.


The main elements of the NodeExpandableTextBox node control are a title and description:

NodeExpandableNodeControl main elements

The NodeExpandableTextBox may be in three states:

  • Not expanded – show only a title;
  • Expanded and the ShowTitleWhenExpanded property is enabled (by default) – show both the title and description;
  • Expanded but the ShowTitleWhenExpanded property is disabled – show only a description.

Example:

NodeExpandableTextBox name = new NodeExpandableTextBox();
name.AttachTo(tree);
 
// add node to the treeview.
NodeWithDescription node = new NodeWithDescription();
node.Text = "Node title";
node.Description = "Node description";
node.AttachTo(tree);
 
// prepare treeview to auto–expanding.
tree.Options.Node.AutoNodeHeight = true;


Title

Title allows you to display short textual information and it is always displayed for a non–expanded node. For an expanded node, it is displayed only when the ShowTitleWhenExpanded is enabled (enabled by default).
To bind a title to a node class`s member, set that member name in the DataFieldName node control property (‘Text’ by default), or supply the title text dynamically when the VirtualMode is enabled by subscribing to the NodeControlValueGet treeview event.

You can easily set the title`s style and behavior using these properties:

  • TitleStyle – defines the title style for a non–expanded node;
  • TitleAlign – defines the title alignment when the title is shorter than the node control width;
  • TitleSupportHtml – defines whether you can show HTML text in the title;
  • TitleTrimming – defines the title trimming mode;
  • TitleWrapMode – defines the title auto–wrapping mode;
  • TitleBottomPadding – defines the vertical gap size in pixels between the title and description;
  • ExpandedTitleStyle – defines the title style for an expanded node;
  • DisplayFormat – defines the title format template;
  • ShowTitleWhenExpanded – defines whether to show a title for an expanded node.



Title style

You can easily combine the title text`s style with the node control`s style by using the TitleStyle.Weak property. If it is enabled, the title style combines with the node control style. If it is disabled, only the TitleStyle property settings will be used as a title text style.


Description

Description allows you to display additional information about an expanded node when it is selected, focused, or under the mouse cursor, and soft selection is enabled. If you need the description to always show, disable the AutoExpand property.
To bind the description to a node, adjust the appropriate node class`s member in the DescriptionDataFieldName  property.
You can easily set the description`s style and behavior using these properties:

  • DescriptionAlign – defines the description alignment when the description is shorter than the node control width;
  • DescriptionDisplayFormat – defines the description format template;
  • DescriptionStyle – defines the description style;
  • DescriptionSupportHtml – defines whether you can show HTML text in the description;
  • DescriptionTrimming – defines the description trimming mode;
  • DescriptionWrapMode – defines the description auto–wrapping mode.



Description style

You can easily combine the description text`s style with the node control`s style by using the DescriptionStyle.Weak property. If it is enabled, the description style combines with the node control style. If it is disabled, only the DescriptionStyle property settings will be used as a description text style.


Expanding

Node expanding is controlled by these parameters:

  • AllowExpand – defines whether the node control may be expanded. If it is disabled, the node control will display only the title text;
  • AutoExpand – defines when the node control will be expanded. If it is enabled, then the node control will be expanded when the node is selected, or when it is under the mouse cursor and the sort selection is enabled. Otherwise, the node control will be always expanded.



HTML support

Title and description supports HTML text display by enabling the TitleSupportHtml and DescriptionSupportHtml properties appropriately.


Text auto–wrapping

Title and description supports text auto–wrapping if it exceed the column or treeview width. To enable it, set the wrap mode in the TitleWrapMode and DescriptionWrapMode properties respectively.

Previous Top Next


Last news
Bookmark and Share
Use Flexible TreeView in WPF project
Sunday, 18 December 2011

Do you have a WPF project and want to use Flexible TreeView there? No problem!

Flexible TreeView v3.4
Friday, 16 December 2011

Flexible TreeView v3.4 maintenance release has been released.

Flexible TreeView v3.3
Friday, 23 September 2011

Flexible TreeView v3.3 maintenance release has been released. Separate assemblies for .NET 2.0, 4.0 and 4.0 Client Profile, HTML markup extension, etc.

Latest release

Version:
Release date:
3.4
Dec 16, 2011


Copyright © 2006-2012 ARMSoft. All rights reserved.