Class TreeViewItem
Represents a item of data in a SfTreeView control.
Inheritance
Implements
Namespace: Syncfusion.UI.Xaml.TreeView
Assembly: Syncfusion.TreeView.WinUI.dll
Syntax
public class TreeViewItem : Control, IDisposable
Constructors
TreeViewItem()
Initializes a new instance of the TreeViewItem class.
Declaration
public TreeViewItem()
Fields
ExpanderPositionProperty
Identifies the ExpanderPosition dependency property.
Declaration
public static readonly DependencyProperty ExpanderPositionProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
ExpanderTemplateProperty
Identifies the ExpanderTemplate dependency property.
Declaration
public static readonly DependencyProperty ExpanderTemplateProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
ExpanderWidthProperty
Identifies the ExpanderWidth dependency property.
Declaration
public static readonly DependencyProperty ExpanderWidthProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
FullRowSelectProperty
Identifies the FullRowSelect dependency property.
Declaration
public static readonly DependencyProperty FullRowSelectProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
IndentationWidthProperty
Identifies the IndentationWidth dependency property.
Declaration
public static readonly DependencyProperty IndentationWidthProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
ItemTemplateProperty
Identifies the ItemTemplate dependency property.
Declaration
public static readonly DependencyProperty ItemTemplateProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
ShowLinesProperty
Identifies the ShowLines dependency property.
Declaration
public static readonly DependencyProperty ShowLinesProperty
Field Value
Type |
---|
Microsoft.UI.Xaml.DependencyProperty |
Properties
ExpanderPosition
Gets or sets the expander position for TreeViewItem.
Enumeration Description Start The expander view will be displayed in start position of TreeViewItem. End The expander view will be displayed in end position of TreeViewItem.
Declaration
public ExpanderPosition ExpanderPosition { get; set; }
Property Value
Type |
---|
ExpanderPosition |
ExpanderTemplate
Gets or sets the data template for the Expander View in TreeViewItem.
Declaration
public DataTemplate ExpanderTemplate { get; set; }
Property Value
Type |
---|
Microsoft.UI.Xaml.DataTemplate |
Remarks
TreeViewNode will be the data context for each TreeViewItem.
ExpanderWidth
Gets or sets the expander width for TreeViewItem.
Declaration
public double ExpanderWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The default value is |
FullRowSelect
Gets or sets a value indicating whether the selection spans the width of tree view control.
Declaration
public bool FullRowSelect { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | The default value is false, where the selection start from indent level only. |
IndentationWidth
Gets or sets the distance to indent for each TreeViewItem.
Declaration
public double IndentationWidth { get; set; }
Property Value
Type |
---|
System.Double |
ItemTemplate
Gets or sets the data template for the Content View in TreeViewItem.
Declaration
public DataTemplate ItemTemplate { get; set; }
Property Value
Type |
---|
Microsoft.UI.Xaml.DataTemplate |
Remarks
TreeViewNode will be the data context for each TreeViewItem.
ShowLines
Gets or sets a value indicating whether lines are drawn in the TreeViewItem.
Declaration
public bool ShowLines { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | true if lines are drawn in TreeViewItem; otherwise, false. The default value is false. |
TreeViewItemInfo
Gets the TreeViewItemInfoBase details of the TreeViewItem.
Declaration
public TreeViewItemInfoBase TreeViewItemInfo { get; }
Property Value
Type |
---|
TreeViewItemInfoBase |
Methods
Dispose()
Dispose all the allocated resources.
Declaration
public void Dispose()
Dispose(Boolean)
Dispose the instances, if parameter is true.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Represents the boolean value for disposing objects. |
OnApplyTemplate()
Builds the visual tree for the TreeViewItem.
Declaration
protected override void OnApplyTemplate()
OnCreateAutomationPeer()
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type |
---|
Microsoft.UI.Xaml.Automation.Peers.AutomationPeer |
OnDoubleTapped(DoubleTappedRoutedEventArgs)
Occurs when mouse doubleclick is released over the item.
Declaration
protected override void OnDoubleTapped(DoubleTappedRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.DoubleTappedRoutedEventArgs | e | The Microsoft.UI.Xaml.Input.DoubleTappedRoutedEventArgs that contains the event data. |
OnHolding(HoldingRoutedEventArgs)
Occurs when the item is long pressed by touch.
Declaration
protected override void OnHolding(HoldingRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.HoldingRoutedEventArgs | e | The Microsoft.UI.Xaml.Input.HoldingRoutedEventArgs that contains the event data. |
OnPointerEntered(PointerRoutedEventArgs)
Occurs when mouse is entered over the TreeViewItem.
Declaration
protected override void OnPointerEntered(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e | The Microsoft.UI.Xaml.Input.PointerRoutedEventArgs that contains the event data. |
OnPointerExited(PointerRoutedEventArgs)
Occurs when the mouse is exiting the TreeViewItem.
Declaration
protected override void OnPointerExited(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e | The Microsoft.UI.Xaml.Input.PointerRoutedEventArgs that contains the event data. |
OnPointerMoved(PointerRoutedEventArgs)
Occurs when the mouse moved over the TreeViewItem.
Declaration
protected override void OnPointerMoved(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.PointerRoutedEventArgs | e | The Microsoft.UI.Xaml.Input.PointerRoutedEventArgs that contains the event data. |
OnRightTapped(RightTappedRoutedEventArgs)
Occurs when mouse right button click is released over the TreeViewItem.
Declaration
protected override void OnRightTapped(RightTappedRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.RightTappedRoutedEventArgs | e | The Microsoft.UI.Xaml.Input.RightTappedRoutedEventArgs that contains the event data. |
OnTapped(TappedRoutedEventArgs)
Occurs when mouse click is released over the TreeViewItem. Collapsed the border visibility for the TreeViewItem by touch.
Declaration
protected override void OnTapped(TappedRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.TappedRoutedEventArgs | e | The Microsoft.UI.Xaml.Input.TappedRoutedEventArgs that contains the event data. |