IDimensionTree.Expanded

Syntax

Expanded(Element: Integer): Boolean;

Parameters

Element. Tree node index.

Description

The Expanded property determines whether a tree node hierarchy is expanded or collapsed.

Comments

Available values:

Example

Executing the example requires that the repository contains a dictionary containing an element hierarchy.

Locate the components DimensionTree, UiDimension, Label, two components Button named DimensionTree1, UiDimension1, Label1, Button1, Button2 respectively.

Set additional properties:

Add links to the Dimensions, ExtCtrls, and Forms system assemblies.

The example is a handler of the OnClick event for the Button components.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
    DimensionTree1.Expand(13True);
    If DimensionTree1.Expanded(13) = True Then
        Label1.Text := "Tree node is expanded";
    End If;
End Sub Button1OnClick;
Sub Button2OnClick(Sender: Object; Args: IMouseEventArgs);
Begin
    DimensionTree1.Collapse(13True);
    If DimensionTree1.Expanded(13) = False Then
        Label1.Text := "Tree node is collapsed";
    End If;
End Sub Button2OnClick;

After executing the example the form will contain elements of the specified dictionary to expand and collapse the tree node hierarchy with the 13 index.

Clicking the Expand button will expand the element hierarchy and the corresponding text will be displayed:

Clicking the Collapse button will collapse the element hierarchy and the corresponding text will be displayed:

See also:

IDimensionTree