Tree.property

Description

Settings for a TreeView DataWindow.

Applies to

TreeView DataWindows

Syntax

Describe and Modify argument:

"DataWindow.Tree.property { = value } “

DataWindow .NET dot notation:

dw_control.TreeViewProperties.property

Parameter

Description

property

A property that controls the appearance or behavior of the TreeView DataWindow. Properties and their settings are listed in the table below.

value

(exp) A string value for the file name of the tree node icon in the detail band.

Value can be a quoted DataWindow expression.

Property for Tree

Value

DefaultExpandToLevel

A long value that is the default level of expansion for the TreeView DataWindow. For example, if the default level is 2, only data with a level less than or equal to 2 is expanded by default.The value must represent a valid level.

Indent

A long value in the units specified for the DataWindow that defines the position of the state icon. The state icon is a plus (+) or minus (-) sign that indicates whether the tree node is in a collapsed or expanded state. The icon’s indent indicates the level of the node in the tree. The X position of the state icon is the X position of its parent plus value.

SelectNodeByMouse

A boolean value that indicates whether you can select a tree node by clicking the node with the mouse.

Values are:

  • Yes – You can select a tree node with a mouse-click (default).

  • No – You cannot select a tree node with a mouse-click.

ShowConnectLines

A boolean value that indicates whether lines connecting parents and children display in the DataWindow object. This property is not supported by the Web DataWindow. If you want to show lines connecting rows in the detail band to their parent, you must also set ShowLeafNodeConnectLines.

Values are:

  • Yes – Display connecting lines (default).

  • No – Do not display connecting lines.

ShowLeafNodeConnectLines

A boolean value that indicates whether lines connecting rows in the detail band to their parent display in the DataWindow object. This property is disabled if Show Lines box is not set. This property is not supported by the Web DataWindow.

Values are:

  • Yes – Display connecting lines (default).

  • No – Do not display connecting lines.

ShowTreeNodeIcon

A boolean value that indicates whether tree node icons for level and detail bands display. If this property is not set, the Expanded and Collapsed Tree Node Icon Name properties in the General category for each TreeView level are disabled.

Values are:

  • No – Do not display tree node icons (default).

  • Yes – Display tree node icons.

StateIconAlignMode

A long value that indicates how the state icon is aligned vertically with respect to the TreeView level band.

Values are:

  • 0 – Middle (default).

  • 1 – Top.

  • 2 – Bottom.

Usage


In the painter

Select the control and set values in the Properties window, General category.

Examples

Example 1

The following code gets and sets the Indent value:

indentVal = dw1.Object.DataWindow.Tree.indent
dw1.Object.DataWindow.Tree.indent = 80

Example 2

The following examples manipulate the SelectNodeByMouse property:

if cbx_selectnodebymouse.checked then 			   ls_selectnodebymouse='yes' 
else
   ls_selectnodebymouse='no'
end if
ls_ret=dw1.modify("datawindow.tree.selectnodebymouse='"+ls_selectnodebymouse+"'")

Example 3

ls_selectnodebymouse=dw1.Describe("datawindow.tree.
selectnodebymouse")
if lower(ls_selectnodebymouse)='no' then
   cbx_selectnodebymouse.checked=false
else
   cbx_selectnodebymouse.checked=true
end if

Example 4

dw1.modify("datawindow.tree.selectnodebymouse='yes'")
dw1.Describe("datawindow.tree.selectnodebymouse")

Example 5

The following examples manipulate the show connecting lines properties:

bShowLines = dw1.TreeViewProperties.ShowConnectLines
dw1.TreeViewProperties.ShowConnectLines=true;

bShowLeafLines = dw1.TreeViewProperties.
ShowLeafNodeConnectLines;

dw1.TreeViewProperties.ShowLeafNodeConnectLines=true;

Example 6

The following example gets the current value of the StateIconAlignMode property and sets it to be aligned at the top:

lAlign = dw1.TreeViewProperties.StateIconAlignMode;

//Align Top 
dw1.TreeViewProperties.StateIconAlignMode = 1;