Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

NextDisplayed Property, CellClass Class

Returns the next displayed cell.

Class: CellClass
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public CellClass NextDisplayed { get; }
Public ReadOnly Property NextDisplayed As CellClass

Value

The next cell or null/Nothing if there is no next cell.

Comments

Returns the next displayed cell.

The next cell is not necessarily the next cell in the item's cell collection. The CellClass.Next property returns the next cell in the cell collection, NextDisplayed returns the next displayed cell.

This property traverses cells one by one, even if cells are part of a group of merged cells. To traverse groups of merged cells, use CellClass.NextMainCell instead.

Examples

C#

                cell.AllowMergeFromUpper = BoolOptionalEnum.True;
                cell.Parts.Clear();
            }
            sftTree1.Footers[1, 4].Parts.Add(new ImagePartClass(img));
            sftTree1.Footers[1, 4].Text = "Vertical cell merging\n(only two cells)";

            // Horizontally merge cells in the second item (column 1 through last)
            item = sftTree1.ItemCollection[1];
            for (cell = item.Cells[1]; cell != null; cell = cell.NextDisplayed) {
                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";

VB.NET

    ' Horizontally merge cells in the second item (column 1 through last)
    item = sftTree1.ItemCollection(1)
    cell = item.Cells(1)
    Do While Not cell Is Nothing
        cell.AllowMergeFromPrevious = BoolOptionalEnum.True
        cell.MergeWithNext = BoolOptionalEnum.True
        cell.Parts.Clear()
        cell = cell.NextDisplayed
    Loop
    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.
    item = sftTree1.ItemCollection(4)
    Do While Not item Is Nothing
        cell = item.Cells(2)

See Also CellClass Class | Classes | SftTree/NET 2.0