In This Article

TreeListView Class

Represents an advanced multi-column tree view control.

public class TreeListView : TreeListBox
Inheritance:
object Visual UIElement FrameworkElement Control ItemsControl TreeListBox object
Derived:
PropertyGrid ShellListView

Constructors

TreeListView()

Initializes an instance of the class.

public TreeListView()

Properties

AreColumnHeadersVisible

Indicates whether column headers are visible.

public bool AreColumnHeadersVisible { get; set; }

Property Value

bool:

true if column headers are visible; otherwise, false. The default value is true.

CanColumnsReorder

Indicates whether columns can be reordered by the end user.

public bool CanColumnsReorder { get; set; }

Property Value

bool:

true if columns can be reordered by the end user; otherwise, false. The default value is false.

CanColumnsResize

Indicates whether columns can be resized by the end user.

public bool CanColumnsResize { get; set; }

Property Value

bool:

true if columns can be resized by the end user; otherwise, false. The default value is true.

CanColumnsToggleVisibility

Indicates whether columns can have their visibility toggled by the end user.

public bool CanColumnsToggleVisibility { get; set; }

Property Value

bool:

true if columns can have their visibility toggled by the end user; otherwise, false. The default value is false.

ColumnHeaderHeight

The height of the column header.

public double ColumnHeaderHeight { get; }

Property Value

double

Columns

The collection of columns in the control.

public ObservableCollection<TreeListViewColumn> Columns { get; }

Property Value

ObservableCollection<TreeListViewColumn>

ExpansionColumnIndex

The index of the columns that contains the indentation and expander button.

public int ExpansionColumnIndex { get; set; }

Property Value

int:

The default value is 0.

FrozenColumnCount

The number of non-scrolling columns, that are always displayed left-most and cannot be scrolled out of visibility.

public int FrozenColumnCount { get; set; }

Property Value

int:

The default value is 0.

IsDefaultColumnHeaderContextMenuEnabled

Indicates whether the default column header context menu is enabled.

public bool IsDefaultColumnHeaderContextMenuEnabled { get; set; }

Property Value

bool:

true if the default column header context menu is enabled; otherwise, false. The default value is true.

IsKeyboardFocusWithinContent

Indicates whether keyboard focus is within the content area, and not in any header area.

protected override bool IsKeyboardFocusWithinContent { get; }

Property Value

bool:

true if keyboard focus is within the content area; otherwise, false.

SizeAllColumnsToFitCommand

The ICommand that sizes all non-star width columns to fit.

public ICommand SizeAllColumnsToFitCommand { get; }

Property Value

ICommand

Methods

ArrangeOverride(Size)

Called to arrange and size the content of a Control object.

protected override Size ArrangeOverride(Size finalSize)
Parameter Type Description
finalSize Size

Returns

Size:

The size of the control.

ClearContainerForItemOverride(DependencyObject, object)

When overridden in a derived class, undoes the effects of the PrepareContainerForItemOverride(DependencyObject, object) method.

protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameter Type Description
element DependencyObject

The container element.

item object

The item.

GetColumnHeaderVisibility(ScrollViewer)

Gets the value of the ColumnHeaderVisibility attached property for the specified object.

public static Visibility GetColumnHeaderVisibility(ScrollViewer obj)
Parameter Type Description
obj ScrollViewer

The object from which the property value is read.

Returns

Visibility

GetContainerForItemOverride()

Creates or identifies the element that is used to display the given item.

protected override DependencyObject GetContainerForItemOverride()

Returns

DependencyObject:

The element that is used to display the given item.

GetFrozenColumnsWidth(ScrollViewer)

Gets the value of the FrozenColumnsWidth attached property for the specified object.

public static double GetFrozenColumnsWidth(ScrollViewer obj)
Parameter Type Description
obj ScrollViewer

The object from which the property value is read.

Returns

double

IsItemItsOwnContainerOverride(object)

Determines if the specified item is (or is eligible to be) its own container.

protected override bool IsItemItsOwnContainerOverride(object item)
Parameter Type Description
item object

The item to check.

Returns

bool:

true if the item is (or is eligible to be) its own container; otherwise, false.

MeasureOverride(Size)

Called to remeasure a control.

protected override Size MeasureOverride(Size availableSize)
Parameter Type Description
availableSize Size

Returns

Size:

The size of the control, up to the maximum specified by constraint.

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

OnColumnHeaderMenuRequested(TreeListViewColumnMenuEventArgs)

Occurs when a column header requests a context menu.

protected virtual void OnColumnHeaderMenuRequested(TreeListViewColumnMenuEventArgs e)
Parameter Type Description
e TreeListViewColumnMenuEventArgs

The event data.

Remarks

This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.

OnColumnHeaderTapped(TreeListViewColumnEventArgs)

Occurs when a column's header is tapped.

protected virtual void OnColumnHeaderTapped(TreeListViewColumnEventArgs e)
Parameter Type Description
e TreeListViewColumnEventArgs

The event data.

Remarks

This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.

OnColumnIsVisibleChanged(TreeListViewColumnEventArgs)

Occurs when a column's visibility has changed.

protected virtual void OnColumnIsVisibleChanged(TreeListViewColumnEventArgs e)
Parameter Type Description
e TreeListViewColumnEventArgs

The event data.

Remarks

This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.

OnColumnReordered(TreeListViewColumnEventArgs)

Occurs after a column is reordered by the end user.

protected virtual void OnColumnReordered(TreeListViewColumnEventArgs e)
Parameter Type Description
e TreeListViewColumnEventArgs

The event data.

Remarks

This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.

OnColumnsResized(RoutedEventArgs)

Occurs after the ActualWidth of one or more columns changes.

protected virtual void OnColumnsResized(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

The event data.

Remarks

This method has no default implementation. Because an intermediate class in the inheritance might implement this method, we recommend that you call the base implementation in your implementation.

OnCreateAutomationPeer()

Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific AutomationPeer implementation.

OnScrollViewerScrollChanged(ScrollChangedEventArgs)

Occurs when the scroll viewer's scroll is changed.

protected override void OnScrollViewerScrollChanged(ScrollChangedEventArgs e)
Parameter Type Description
e ScrollChangedEventArgs

The event data.

PrepareContainerForItemOverride(DependencyObject, object)

Prepares the specified element to display the specified item.

protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameter Type Description
element DependencyObject

Element used to display the specified item.

item object

Specified item.

SetColumnHeaderVisibility(ScrollViewer, Visibility)

Sets the value of the ColumnHeaderVisibility attached property to the specified object.

public static void SetColumnHeaderVisibility(ScrollViewer obj, Visibility value)
Parameter Type Description
obj ScrollViewer

The object to which the attached property is written.

value Visibility

The value to set.

SetFrozenColumnsWidth(ScrollViewer, double)

Sets the value of the FrozenColumnsWidth attached property to the specified object.

public static void SetFrozenColumnsWidth(ScrollViewer obj, double value)
Parameter Type Description
obj ScrollViewer

The object to which the attached property is written.

value double

The value to set.

SizeAllColumnsToFit()

Sizes all non-star width columns to fit.

public void SizeAllColumnsToFit()

Events

ColumnHeaderMenuRequested

Occurs when a column header requests a context menu.

public event EventHandler<TreeListViewColumnMenuEventArgs> ColumnHeaderMenuRequested

Event Type

EventHandler<TreeListViewColumnMenuEventArgs>

ColumnHeaderTapped

Occurs when a column's header is tapped.

public event EventHandler<TreeListViewColumnEventArgs> ColumnHeaderTapped

Event Type

EventHandler<TreeListViewColumnEventArgs>

ColumnIsVisibleChanged

Occurs when a column's visibility has changed.

public event EventHandler<TreeListViewColumnEventArgs> ColumnIsVisibleChanged

Event Type

EventHandler<TreeListViewColumnEventArgs>

ColumnReordered

Occurs after a column is reordered by the end user.

public event EventHandler<TreeListViewColumnEventArgs> ColumnReordered

Event Type

EventHandler<TreeListViewColumnEventArgs>

ColumnsResized

Occurs after the ActualWidth of one or more columns changes.

public event RoutedEventHandler ColumnsResized

Event Type

RoutedEventHandler

Fields

AreColumnHeadersVisibleProperty

Defines the AreColumnHeadersVisible property.

public static readonly DependencyProperty AreColumnHeadersVisibleProperty

CanColumnsReorderProperty

Defines the CanColumnsReorder property.

public static readonly DependencyProperty CanColumnsReorderProperty

CanColumnsResizeProperty

Defines the CanColumnsResize property.

public static readonly DependencyProperty CanColumnsResizeProperty

CanColumnsToggleVisibilityProperty

Defines the CanColumnsToggleVisibility property.

public static readonly DependencyProperty CanColumnsToggleVisibilityProperty

ColumnHeaderHeightProperty

Defines the ColumnHeaderHeight property.

public static readonly DependencyProperty ColumnHeaderHeightProperty

ColumnHeaderMenuRequestedEvent

Defines the ColumnHeaderMenuRequested routed event.

public static readonly RoutedEvent ColumnHeaderMenuRequestedEvent

ColumnHeaderTappedEvent

Defines the ColumnHeaderTapped routed event.

public static readonly RoutedEvent ColumnHeaderTappedEvent

ColumnHeaderVisibilityProperty

Defines the ColumnHeaderVisibility property.

public static readonly DependencyProperty ColumnHeaderVisibilityProperty

ColumnIsVisibleChangedEvent

Defines the ColumnIsVisibleChanged routed event.

public static readonly RoutedEvent ColumnIsVisibleChangedEvent

ColumnReorderedEvent

Defines the ColumnReordered routed event.

public static readonly RoutedEvent ColumnReorderedEvent

ColumnsResizedEvent

Defines the ColumnsResized routed event.

public static readonly RoutedEvent ColumnsResizedEvent

ExpansionColumnIndexProperty

Defines the ExpansionColumnIndex property.

public static readonly DependencyProperty ExpansionColumnIndexProperty

FrozenColumnCountProperty

Defines the FrozenColumnCount property.

public static readonly DependencyProperty FrozenColumnCountProperty

FrozenColumnsWidthProperty

Defines the FrozenColumnsWidth property.

public static readonly DependencyProperty FrozenColumnsWidthProperty

IsDefaultColumnHeaderContextMenuEnabledProperty

public static readonly DependencyProperty IsDefaultColumnHeaderContextMenuEnabledProperty

Inherited Members

Extension Methods