Hide

SftTree/NET 2.0 - Tree Control for Windows Forms

Display
Print

Columns Property, SftTree Class

Returns the control's ColumnsClass instance describing all columns.

Class: SftTree
Namespace: Softelvdm.SftTreeNET
Assembly: Softelvdm.SftTreeNET

Syntax

public ColumnsClass Columns { get; }
Public ReadOnly Property Columns As ColumnsClass

Value

The ColumnsClass class instance.

Comments

Returns the control's ColumnsClass instance describing all columns.

The instance of the ColumnsClass class describes attributes that apply to all columns in a SftTree/NET control. Numerous properties and methods can be accessed using the returned object.

A control has only one ColumnsClass instance.

Examples

C#

             AddItem(cat, img, "Item bb");
             AddItem(cat, img, "Item cc");
             AddItem(cat, img, "Item dd");
             AddItem(cat, img, "Item ee");
            cat = AddCategory("Category 7");
             AddItem(cat, img, "Item 123");
             AddItem(cat, img, "Item abc");
                        
            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];

VB.NET

     AddItem(cat, img, "Item bb")
     AddItem(cat, img, "Item cc")
     AddItem(cat, img, "Item dd")
     AddItem(cat, img, "Item ee")
    cat = AddCategory("Category 7")
     AddItem(cat, img, "Item 123")
     AddItem(cat, img, "Item abc")

    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)

See Also SftTree Class | Classes | SftTree/NET 2.0