Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Cells Property, ItemClass Class

Returns the item's cell collection.

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

Syntax

public CellCollectionClass Cells { get; }
Public ReadOnly Property Cells As CellCollectionClass

Value

The cell collection.

Comments

Returns the item's cell collection.

Cells in the cell collection are displayed one for each defined column (ColumnsClass.Count). If there are fewer cells in the cell collection than columns, the remaining columns are empty. If there are more cells than columns, the extraneous cells are simply ignored.

Examples

C#

            sftTree1.Columns.MakeOptimal(0, false);
            sftTree1.RecalcHorizontalExtent();
            sftTree1.Initializing = false;
        }

        private ItemClass AddCategory(string Category) {
            ItemClass item = sftTree1.ItemCollection.Add();
            CellClass cell = item.Cells[0];
            cell.Appearance = BackgroundAppearanceEnum.ThemedSystemHeaderNeverPressed;
            cell.Parts.Add(new ImagePartClass(m_PlusImage));
            cell.Parts.Add(new TextPartClass(Category));
            item.TagString = "This is a tooltip explaining " + Category;
            return item;
        }
        private void AddItem(ItemClass cat, Image img, string ItemText) {
            ItemClass item = cat.Add();

VB.NET

    sftTree1.Columns.MakeOptimal(0, False)
    sftTree1.RecalcHorizontalExtent()
    sftTree1.Initializing = False
End Sub

Private Function AddCategory(ByVal Category As String) As ItemClass
    Dim item As ItemClass = sftTree1.ItemCollection.Add()
    Dim cell As CellClass = item.Cells(0)
    cell.Appearance = BackgroundAppearanceEnum.ThemedSystemHeaderNeverPressed
    cell.Parts.Add(New ImagePartClass(m_PlusImage))
    cell.Parts.Add(New TextPartClass(Category))
    item.TagString = "This is a tooltip explaining " & Category
    Return item
End Function

Private Sub AddItem(ByVal cat As ItemClass, ByVal img As Image, ByVal ItemText As String)

See Also ItemClass Class | Classes | SftTree/NET 2.0