Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

HasChildren Property, ItemClass Class

Returns whether this item has dependents.

Class: ItemClass
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public bool HasChildren { get; }
Public ReadOnly Property HasChildren As Boolean

Value

True if this item has dependents, otherwise False.

Comments

Returns whether this item has dependents.

The dependents can be accessed using the ItemClass.Children property.

A count of dependents can be retrieved using the ItemClass.DirectChildCount and ItemClass.TotalChildCount properties.

Examples

C#

            LoadAssembly(Assembly.GetExecutingAssembly());
        }

        private void ExpandCollapseItem(ItemClass item)
        {
            if (item.Expanded)
                item.Collapse(CollapseStyleEnum.SaveCurrent);
            else {
                if (item.HasChildren)
                    item.Expand(ExpandStyleEnum.RestoreLast);
                else {
                    sftTree1.Initializing = true;
                    if (item.TagString == "Single") {
                        item._CreateChildren = true;
                        ListInfo(item.Children, item.TagObject);
                    } else {

VB.NET

    sftTree1.RowHeaders.Width = 0
    LoadAssembly(Assembly.GetExecutingAssembly())
End Sub

Private Sub ExpandCollapseItem(ByVal item As ItemClass)
    If item.Expanded Then
        item.Collapse(CollapseStyleEnum.SaveCurrent)
    Else
        If (item.HasChildren) Then
            item.Expand(ExpandStyleEnum.RestoreLast)
        Else
            sftTree1.Initializing = True
            If item.TagString = "Single" Then
                item._CreateChildren = True
                ListInfo(item.Children, item.TagObject)
            Else

See Also ItemClass Class | Classes | SftTree/NET 2.0