Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

NextSibling Property, ItemClass Class

Returns the item's next sibling item.

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

Syntax

public ItemClass NextSibling { get; }
Public ReadOnly Property NextSibling As ItemClass

Value

The next sibling item or null/Nothing if there is no sibling item.

Comments

Returns the item's next sibling item.

The next sibling of the item is found by scanning towards the end of the tree control and locating an item on the same level (ItemClass.Level property) as the current item without encountering a parent item on a higher level.

Examples

C#

                cell.AllowMergeFromPrevious = BoolOptionalEnum.True;
                cell.MergeWithNext = BoolOptionalEnum.True;
                cell.Parts.Clear();
            }
            item.Cells[1].Parts.Add(new ImagePartClass(img));
            item.Cells[1].Text = "Horizontally merged cells";

            // Vertically merge a few cells (in the third column) starting with the fifth item.
            for (item = sftTree1.ItemCollection[4] ; item != null; item = item.NextSibling) {
                cell = item.Cells[2];
                cell.AllowMergeFromUpper = BoolOptionalEnum.True;
                cell.MergeWithLower = BoolOptionalEnum.True;
                cell.Parts.Clear();
            }
            cell = sftTree1.ItemCollection[4].Cells[2];
            cell.Text = "Vertically\nmerged\ncells";

VB.NET

    ' Vertically merge a few cells (in the third column) starting with the fifth item.
    item = sftTree1.ItemCollection(4)
    Do While Not item Is Nothing
        cell = item.Cells(2)
        cell.AllowMergeFromUpper = BoolOptionalEnum.True
        cell.MergeWithLower = BoolOptionalEnum.True
        cell.Parts.Clear()
        item = item.NextSibling
    Loop
    cell = sftTree1.ItemCollection(4).Cells(2)
    cell.Text = "Vertically" & vbCrLf & "merged" & vbCrLf & "cells"
    cell.Image = img

    ' Merge 3 row headers, starting at the second item
    Dim count As Integer = 3
    item = sftTree1.ItemCollection(1)

See Also ItemClass Class | Classes | SftTree/NET 2.0