Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Children Property, ItemClass Class

Returns the dependent items of this item.

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

Syntax

public ItemCollectionClass Children { get; }
Public ReadOnly Property Children As ItemCollectionClass

Value

The collection of dependents or null/Nothing if this item doesn't have any dependents.

Comments

Returns the dependent items of this item.

Child items (or dependents) can be added using the methods exposed by the ItemClass class, such as ItemClass.Add and ItemClass.InsertAfter or the ItemCollectionClass class, such as ItemCollectionClass.Add.

Once an item has been added, parts (such as instances of the TextPartClass) can be added to the cell.

The ItemClass.RemoveChildren method can be used to remove an item's dependents.

If many items are added, the SoftelvdmUserControl.Initializing property can be used to indicate a mass-update, which is significantly faster.

Examples

C#

                        sval = val.ToString();
                    else
                        sval = "(null)";
                } catch {
                    sval = "(?)";
                }
                item.Add(new string[] { p.Name, sval });
            }
            item.Children.Sort();
        }

        private void ListInfo(ItemCollectionClass itemCollection, object o) {

            Type tp = o.GetType();

            ItemClass  item = itemCollection.Add("Custom Attributes");

VB.NET

            Else
                sval = "(null)"
            End If
        Catch
            sval = "(?)"
        End Try
        item.Add(New String() {p.Name, sval})
    Next
    item.Children.Sort()
End Sub

Private Sub ListInfo(ByVal itemCollection As ItemCollectionClass, ByVal o As Object)

    Dim tp As Type = o.GetType()

    Dim item As ItemClass = itemCollection.Add("Custom Attributes")

See Also ItemClass Class | Classes | SftTree/NET 2.0