IDimElements.AllChildrenCount

Syntax

AllChildrenCount(Element: Integer): Integer;

Parameters

Element - dictionary element index.

Description

The AllChildrenCount property returns total number of children for the element with the Element index.

Comments

This property returns the total number of child elements at all levels below the Element element. To get the number of direct child elements positioned one level below the element, use the ChildrenCount property.

Example

Executing the example requires a form, a button named Button1 positioned on this form, the UiDimension component named UiDimension1, and the DimensionTree component named DimensionTree1. A repository dictionary is linked to UiDimension1. UiDimension1 is used as the data source for DimensionTree1.

Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
    Elems: IDimElements;
Begin
    If DimensionTree1.FocusedElement <> -1 Then
        Elems := UiDimension1.DimInstance.Elements;
        Debug.WriteLine(Elems.AllChildrenCount(DimensionTree1.FocusedElement));
        Debug.WriteLine(Elems.ChildrenCount(DimensionTree1.FocusedElement));
    End If;
End Sub Button1OnClick;

After executing the example on clicking the button the development environment console displays total number of child elements and the number of direct child elements for the element focused in the DimensionTree1 component.

See also:

IDimElements