HeaderPane
Main
Hide
Share Link
Print

Selected Property, ItemClass Class

Defines whether this item is selected.

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

Syntax

public bool Selected { get; set; }
Public Property Selected As Boolean

Value

True if selected, otherwise False.

Comments

Defines whether this item is selected.

The Selected property is only available if the SftTree.SelectionStyle property allows item selection (SelectionStyleEnum.SingleItem, SelectionStyleEnum.MultipleItems). It cannot be used if cell selection (SelectionStyleEnum.SingleCell, SelectionStyleEnum.MultipleCells, SelectionStyleEnum.BlockOfCells) is in effect.

When an item is selected, the SelectionChanged event occurs.

Examples

C# View entire sample code

        private void ExpandCollapseButtonsNormal() {
            sftTree1.ButtonLook = ButtonLookEnum.ThemedSystem;
            sftTree1.TreeLinesPen = LinesPenStyleEnum.Solid;
            sftTree1.TreeLineStyle = TreeLineStyleEnum.AllLevels;
        }

        private void SelectOneItem() {
            sftTree1.SelectionStyle = SelectionStyleEnum.SingleItem;
            sftTree1.ItemCollection[0].Children[0].Selected = true;
        }
        private void SelectItems() {
            sftTree1.SelectionStyle = SelectionStyleEnum.MultipleItems;
            sftTree1.ItemCollection[0].Children[0].Selected = true;
            sftTree1.ItemCollection[0].Children[0].Children[0].Selected = true;
        }
        private void SelectOneCell() {

VB.NET View entire sample code

Private Sub ExpandCollapseButtonsNormal()
    sftTree1.ButtonLook = ButtonLookEnum.ThemedSystem
    sftTree1.TreeLinesPen = LinesPenStyleEnum.Solid
    sftTree1.TreeLineStyle = TreeLineStyleEnum.AllLevels
End Sub

Private Sub SelectOneItem()
    sftTree1.SelectionStyle = SelectionStyleEnum.SingleItem
    sftTree1.ItemCollection(0).Children(0).Selected = True
End Sub
Private Sub SelectItems()
    sftTree1.SelectionStyle = SelectionStyleEnum.MultipleItems
    sftTree1.ItemCollection(0).Children(0).Selected = True
    sftTree1.ItemCollection(0).Children(0).Children(0).Selected = True
End Sub
Private Sub SelectOneCell()

See Also ItemClass Class | Classes | SftTree/NET 3.0