Table of Contents

Class TreeViewItem

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

Represents an item in a tree control.

public class TreeViewItem : ListControlItemWithNotify, IBaseObjectWithAttr, IBaseObjectWithId, IBaseObject, INotifyPropertyChanged, IComparable<ListControlItem>, IComparable<TreeViewItem>
Inheritance
TreeViewItem
Implements
Derived

Constructors

TreeViewItem()

Initializes a new instance of the TreeViewItem class.

TreeViewItem(string)

Initializes a new instance of the TreeViewItem class with the specified text.

TreeViewItem(string, int?)

Initializes a new instance of the TreeViewItem class with the specified item text and the image index position of the item's icon.

Properties

AutoCollapseSiblings

Indicates whether expanding this tree item should automatically collapse its sibling items. When enabled, the item enforces exclusive expansion behavior within its level in the hierarchy.

CheckBoxVisible

Gets or sets whether to show check box inside the item. This property (if specified) overrides global checkboxes visibility setting in the control.

CheckState

Gets or sets state of the check box associated with the item.

ExpandOnClick

Gets or sets whether item is expanded when it is clicked.

FirstChild

Gets the first child item of this tree control item.

ForegroundMargin

Gets or sets margin of the item when foreground is painted.

Handle

Gets or sets item handle. This is used only when item is connected to native control.

HasCollapsedParents

Gets whether item has collapsed parents.

HasItems

Gets a value indicating whether this item has child items.

HasVisibleItems

Gets a value indicating whether this item has any visible child items.

IndentLevel

Gets the indent level of this item.

Index

Gets the zero-based index of the current item within its parent, or null if the item has no parent.

IsExpanded

Gets or sets a value indicating whether this item is expanded.

IsFirst

Gets a value indicating whether this item is the first item in its parent items collection.

IsLast

Gets a value indicating whether this item is the last item in its parent items collection.

IsRoot

Gets whether this control is the root control (has no parent).

IsRootChild

Gets whether this item is a child of the root item.

IsSelected

Gets or sets a value indicating whether the current item is selected.

IsVisible

Gets or sets a value indicating whether this item is visible.

ItemCount

Gets the number of child items in this tree control item.

Items

Gets the child items of this tree control item.

LastChild

Gets the last child item of this tree control item.

NextOrPrevSibling

Gets next sibling if item is not the last one, otherwise gets previous sibling. If item has no siblings, Parent is returned.

Owner

Gets the owner of this tree control item.

Parent

Gets or sets the parent item of this tree control item.

ParentItems

Gets items from the StdTreeView (if item is on root level) or from the Parent (if item has parent).

Root

Gets the root parent control in the chain of parent controls. If parent control is null, returns this control.

Methods

Add(TreeViewItem)

Adds the specified child item to this tree control item.

AddRange(IEnumerable<TreeViewItem>)

Adds a range of TreeViewItem child items to this tree control item.

AddWithText(string)

Creates a new TreeViewItem, assigns text to it, adds it as the last child of this item in the tree, and returns it.

Assign(TreeViewItem)

Copies the properties and child items from the specified TreeViewItem to the current instance.

Clear()

Clears all child items from this tree control item.

Clone()

Creates a new instance of the TreeViewItem class with the same properties as the current instance.

Collapse()

Collapses the tree item.

CollapseAll()

Collapses this item and all the child items recursively. After calling this method, value of IsExpanded property will be false for this item and all its child items.

CollapseItems(bool)

Collapses child items.

CompareTo(TreeViewItem?)

Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

CreateItem()

Creates a new instance of TreeViewItem.

DoInsideUpdate(Action, bool)

Calls the specified action inside an update block, ensuring that the owner of this tree control item is updated correctly.

EnsureVisible()

Ensures that the tree item is visible, expanding tree items and scrolling the tree view control as necessary.

EnumExpandedItems(EnumExpandedItemsParams?)

Retrieves all child items of this tree control item. If a child item is expanded, its children are also included in the result. All child items are processed recursively.

Expand()

Expands the tree item.

ExpandAll()

Expands this item and all the child items recursively. After calling this method, value of IsExpanded property will be true for this item and all its child items.

ExpandAllParents()

Expands all parent items of this tree control item.

ExpandItems(bool)

Expands child items.

GetCheckBoxInfo(IListControlItemContainer?, RectD)

Retrieves information about the checkbox associated with the item, including its visibility, state, size, and position.

GetItem(int)

Retrieves the child item at the specified index.

Insert(int, TreeViewItem)

Inserts the specified TreeViewItem at the given index within the item list.

OnPropertyChanged(string?)

Called when object property is changed.

Prepend(TreeViewItem)

Inserts the specified TreeViewItem at the beginning of the item list.

PrependWithText(string)

Creates a new TreeViewItem, assigns text to it, adds it as the first child of this item in the tree, and returns it.

Remove()

Removes the tree item from the tree view control.

Remove(TreeViewItem)

Removes the specified child item from this tree control item.

ResetCachedImages()

Clears all cached images, forcing them to be reloaded on the next access.

ScrollIntoView()

Scrolls the item into view.

SetItems(IEnumerable<TreeViewItem>)

Sets child items of this tree control item to the specified collection.

SetItemsExpanded(bool, bool)

Sets IsExpanded property of child items.

SetItemsExpandedRecursive(bool, bool)

Sets IsExpanded property of child items recursively.

SetSelected(IListControlItemContainer?, bool)

Sets whether item is selected.

SmartInvoke(Action)

Used to invoke the update action.

Sort()

Sorts child items in ascending order.

Sort(IComparer<TreeViewItem>?)

Sorts the child items of the current TreeViewItem using the specified comparer.

Sort(int, int, IComparer<TreeViewItem>?)

Sorts a range of child items using the specified comparer.

SortDescending()

Sorts the items in descending order based on their comparison logic.

SortDescending(Comparison<TreeViewItem>)

Sorts the items in descending order based on the specified comparison logic.

SortDescending<T2>(Comparison<T2>)

Sorts the items in descending order based on the specified comparison logic.

Sort<T2>(Comparison<T2>)

Sorts child items using the specified comparison.

Toggle()

Toggles the tree item to either the expanded or collapsed state.