Table of Contents

Method EnsureVisible

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

EnsureVisible(TreeViewItem?)

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

public virtual void EnsureVisible(TreeViewItem? item)

Parameters

item TreeViewItem

Remarks

When this method is cis called, the tree is expanded and scrolled to ensure that the current tree item is visible in the control. This method is useful if you are selecting a tree item in code based on certain criteria. By calling this method after you select the item, the user can see and interact with the selected item.

EnsureVisible(int)

Ensures that the child item of the root item with the specified index is visible within the tree view control.

public virtual bool EnsureVisible(int index)

Parameters

index int

The zero-based index of the item to make visible.

Returns

bool

true if the item was successfully scrolled into view; otherwise, false.

Remarks

This method scrolls the tree view as necessary to bring the specified item into view. If the index is out of range or the item is already visible, no action is taken.