Class TreeViewItemAdv
Implements a selectable item in a TreeViewAdv control.
Inheritance
Implements
Namespace: Syncfusion.Windows.Tools.Controls
Assembly: Syncfusion.Tools.Wpf.dll
Syntax
public class TreeViewItemAdv : HeaderedItemsControl, ICloneable, IItemsPanelRef, IItemContainer, IDisposable
Remarks
Content Model: The TreeViewItemAdv control is a System.Windows.Controls.HeaderedItemsControl and has three content properties: System.Windows.Controls.HeaderedItemsControl.HeaderProperty, System.Windows.Controls.ItemsControl.Items, and System.Windows.Controls.ItemsControl.ItemsSourceProperty.
TreeViewItemAdv controls can be embedded inside other TreeViewItemAdv controls to create a hierarchy of nodes inside a TreeViewAdv control.
Examples
The following example shows how to create a hierarchy of TreeViewItemAdv controls in a TreeViewAdv control in XAML.
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Window1" Height="300" Width="300">
<Grid>
<local:TreeViewAdv>
<local:TreeViewItemAdv Header="Employee1">
<local:TreeViewItemAdv Header="Jesper"/>
<local:TreeViewItemAdv Header="Aaberg"/>
<local:TreeViewItemAdv Header="12345"/>
</local:TreeViewItemAdv>
<local:TreeViewItemAdv Header="Employee2">
<local:TreeViewItemAdv Header="Dominik"/>
<local:TreeViewItemAdv Header="Paiha"/>
<local:TreeViewItemAdv Header="98765"/>
</local:TreeViewItemAdv>
</local:TreeViewAdv>
</Grid>
</Window>
Constructors
TreeViewItemAdv()
Initializes a new instance of the TreeViewItemAdv class.
Declaration
public TreeViewItemAdv()
TreeViewItemAdv(String)
Initializes a new instance of the TreeViewItemAdv class.
Declaration
public TreeViewItemAdv(string header)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | header | The header. |
Fields
AfterItemEditEvent
Identified by the AfterItemEdit routed_event.
Declaration
public static readonly RoutedEvent AfterItemEditEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
BeforeItemEditEvent
Identified by the BeforeItemEdit routed_event.
Declaration
public static readonly RoutedEvent BeforeItemEditEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
CollapsedEvent
Identifies the Collapsed routed_event. This field is read-only.
Declaration
public static readonly RoutedEvent CollapsedEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
CollapsedImageSourceProperty
Identifies TreeViewItemAdv. CollapsedImageSource dependency property.
Declaration
public static readonly DependencyProperty CollapsedImageSourceProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Edit
Command responsible for editing TreeViewItemAdv in TreeViewAdv.
Declaration
public static RoutedCommand Edit
Field Value
| Type |
|---|
| System.Windows.Input.RoutedCommand |
EditKeyDownEvent
Identified by the EditKeyDown routed_event.
Declaration
public static readonly RoutedEvent EditKeyDownEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
EditKeyUpEvent
Identified by the EditKeyUp routed_event.
Declaration
public static readonly RoutedEvent EditKeyUpEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
ExpandAnimationProperty
Identifies TreeViewItemAdv. ExpandAnimation dependency property.
Declaration
public static DependencyProperty ExpandAnimationProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ExpandedEvent
Identifies the Expanded routed_event.
Declaration
public static readonly RoutedEvent ExpandedEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
ExpandedImageSourceProperty
Identifies TreeViewItemAdv. ExpandedImageSource dependency property.
Declaration
public static readonly DependencyProperty ExpandedImageSourceProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
FadeAnimationProperty
Identifies TreeViewItemAdv. FadeAnimation dependency property.
Declaration
public static DependencyProperty FadeAnimationProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
HasFakeItemsProperty
Identifies TreeViewAdv.HasFakeItemsProperty dependency property.
Declaration
public static readonly DependencyProperty HasFakeItemsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
HeaderTextDecorationsProperty
Identifies TreeViewItemAdv. HeaderTextDecorations dependency property.
Declaration
public static readonly DependencyProperty HeaderTextDecorationsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ImageHeightProperty
Identifies TreeViewItemAdv. ImageHeight dependency property.
Declaration
public static readonly DependencyProperty ImageHeightProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ImageStretchProperty
Identifies TreeViewItemAdv. ImageStretch dependency property.
Declaration
public static readonly DependencyProperty ImageStretchProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
ImageWidthProperty
Identifies TreeViewItemAdv. ImageWidth dependency property.
Declaration
public static readonly DependencyProperty ImageWidthProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsCustomToolTipEnabledProperty
Identifies TreeViewItemAdv. IsCustomToolTipEnabled dependency property.
Declaration
public static readonly DependencyProperty IsCustomToolTipEnabledProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsDragingProperty
Identifies TreeViewItemAdv. IsDraging dependency property.
Declaration
public static readonly DependencyProperty IsDragingProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsDragOverProperty
Identifies TreeViewAdv. IsDragOver dependency property.
Declaration
public static readonly DependencyProperty IsDragOverProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsEditableProperty
Identifies TreeViewItemAdv. IsEditable dependency property.
Declaration
public static readonly DependencyProperty IsEditableProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsExpandedProperty
Identifies TreeViewItemAdv. IsExpanded dependency property.
Declaration
public static readonly DependencyProperty IsExpandedProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsInEditModeProperty
Identifies TreeViewItemAdv. IsEdited dependency property.
Declaration
public static readonly DependencyProperty IsInEditModeProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsLoadingProperty
Declaration
public static readonly DependencyProperty IsLoadingProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsLoadOnDemandProperty
Declaration
public static readonly DependencyProperty IsLoadOnDemandProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsReadOnlyProperty
Identifies TreeViewItemAdv. IsReadOnly dependency property.
Declaration
public static readonly DependencyProperty IsReadOnlyProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsSelectedFalseProperty
Identifies TreeViewItemAdv. IsSelected dependency property.
Declaration
public static readonly DependencyProperty IsSelectedFalseProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsSelectedProperty
Identifies TreeViewItemAdv. IsSelected dependency property.
Declaration
public static readonly DependencyProperty IsSelectedProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsSelectionActiveProperty
Identifies TreeViewItemAdv.IsSelectionActiveProperty dependency property.
Declaration
public static readonly DependencyProperty IsSelectionActiveProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
IsSelectionActivePropertyKey
Identifies TreeViewItemAdv. IsSelectionActive dependency property.
Declaration
public static readonly DependencyPropertyKey IsSelectionActivePropertyKey
Field Value
| Type |
|---|
| System.Windows.DependencyPropertyKey |
IsShowToolTipProperty
Identifies TreeViewItemAdv. IsShowToolTip dependency property.
Declaration
public static readonly DependencyProperty IsShowToolTipProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LeftImageSourceProperty
Identifies TreeViewItemAdv. LeftImageSource dependency property.
Declaration
public static readonly DependencyProperty LeftImageSourceProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LoadingHeaderProperty
Declaration
public static readonly DependencyProperty LoadingHeaderProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
LoadingHeaderTemplateProperty
Declaration
public static readonly DependencyProperty LoadingHeaderTemplateProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
MultiColumnEnableProperty
Identifies TreeViewItemAdv. MultiColumnEnable dependency property.
Declaration
public static readonly DependencyProperty MultiColumnEnableProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
RightImageSourceProperty
Identifies TreeViewItemAdv. RightImageSource dependency property.
Declaration
public static readonly DependencyProperty RightImageSourceProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
SelectedEvent
Identified by the Selected routed_event. This field is read-only.
Declaration
public static readonly RoutedEvent SelectedEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
SortingProperty
Identifies TreeViewItemAdv. Sorting dependency property.
Declaration
public static readonly DependencyProperty SortingProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
UnselectedEvent
Identified by the Unselected routed_event.
Declaration
public static readonly RoutedEvent UnselectedEvent
Field Value
| Type |
|---|
| System.Windows.RoutedEvent |
Properties
CollapsedImageSource
Gets or sets ImageSource to collapsed image.
Declaration
public ImageSource CollapsedImageSource { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.ImageSource | Type: System.Windows.Media.ImageSource The source of the image. The default value is null. |
Examples
This example shows how to set CollapsedImageSource property in XAML.
<Window x:Class="Sample1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Window1" Height="300" Width="300">
<StackPanel Name="stackPanel">
<local:TreeViewAdv Name="myTreeview">
<local:TreeViewItemAdv Header="Employee1" CollapsedImageSource="images/image1.png">
<local:TreeViewItemAdv Header="Jesper" CollapsedImageSource="images/image2.png"/>
</local:TreeViewItemAdv>
</local:TreeViewAdv>
</StackPanel>
</Window>
See Also
EditedItemTemplate
Gets or sets the DataTemplate used to display each item in edit mode.
Declaration
public DataTemplate EditedItemTemplate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.DataTemplate | Type: System.Windows.DataTemplate A System.Windows.DataTemplate that specifies the visualization of the data objects. |
Examples
This example shows how to set EditedItemTemplate property in XAML.
<Window x:Class="Sample1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<DataTemplate x:Key="CustomEditedItemTemplate" DataType="{x:Type des:TreeViewItemAdv}">
<Border BorderBrush="Red" BorderThickness="1" Margin="1" Padding="2">
<TextBox Text="{Binding Path=(des:TreeViewItemAdv.Header), Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type des:TreeViewItemAdv}}}"/>
</Border>
</DataTemplate>
</Window.Resources>
<StackPanel Name="stackPanel">
<local:TreeViewAdv Name="myTreeview">
<local:TreeViewItemAdv Header="Employee1" EditedItemTemplate="{StaticResource CustomEditedItemTemplate}">
<local:TreeViewItemAdv Header="Jesper"/>
<local:TreeViewItemAdv Header="Aaberg"/>
<local:TreeViewItemAdv Header="12345"/>
</local:TreeViewItemAdv>
<local:TreeViewItemAdv Header="Employee2">
<local:TreeViewItemAdv Header="Dominik"/>
<local:TreeViewItemAdv Header="Paiha"/>
<local:TreeViewItemAdv Header="98765"/>
</local:TreeViewItemAdv>
</local:TreeViewAdv>
</StackPanel>
</Window>
See Also
EditedItemTemplateSelector
Gets or sets the edited item template selector.
Declaration
public DataTemplateSelector EditedItemTemplateSelector { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Controls.DataTemplateSelector | The edited item template selector. |
ExpandAnimation
Gets or sets the expand animation.
Declaration
public DoubleAnimation ExpandAnimation { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.Animation.DoubleAnimation | The expand animation. |
ExpandedImageSource
Gets or sets ImageSource to expanded image.
Declaration
public ImageSource ExpandedImageSource { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.ImageSource | Type: System.Windows.Media.ImageSource The source of the image. The default value is null. |
Examples
This example shows how to set ExpandedImageSource property in XAML.
<Window x:Class="Sample1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Window1" Height="300" Width="300">
<StackPanel Name="stackPanel">
<local:TreeViewAdv Name="myTreeview">
<local:TreeViewItemAdv Header="Employee1" ExpandedImageSource="images/image1.png">
<local:TreeViewItemAdv Header="Jesper" ExpandedImageSource="images/image2.png"/>
</local:TreeViewItemAdv>
</local:TreeViewAdv>
</StackPanel>
</Window>
See Also
ExpanderStyle
Gets or sets a property that enables customization of appearance, effects, or other style expander that will apply to nodes.
Declaration
public Style ExpanderStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Style | Type: System.Windows.Style The desired style to apply on expander. |
Examples
This example shows how to set ExpanderStyle property in XAML.
<Window x:Class="Sample1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Window1" Height="300" Width="300">
<Window.Resources>
<!-- Template for TreeViewAdvExpander -->
<ControlTemplate x:Key="MyFxExpanderTemplateKey" TargetType="{x:Type Expander}">
<ToggleButton Name="Expander"
ClickMode="Press"
IsChecked="{Binding Path=IsExpanded, RelativeSource={RelativeSource TemplatedParent}}">
<ToggleButton.Style>
<Style TargetType="ToggleButton">
<Setter Property="FrameworkElement.Focusable" Value="False"/>
<Setter Property="FrameworkElement.Width" Value="19"/>
<Setter Property="FrameworkElement.Height" Value="13"/>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border Height="10" Width="10" BorderBrush="Black" BorderThickness="1">
<Border Name="BagroundBorder" Background="Blue">
</Border>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="ToggleButton.IsChecked" Value="True">
<Setter Property="Background" TargetName="BagroundBorder" Value="Red"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ToggleButton.Style>
</ToggleButton>
</ControlTemplate>
<!-- Style for TreeViewAdvExpander -->
<Style x:Key="MyEStyle" TargetType="{x:Type Expander}">
<Setter Property="Template" Value="{StaticResource MyFxExpanderTemplateKey}"/>
</Style>
</Window.Resources>
<StackPanel Name="stackPanel">
<local:TreeViewAdv Name="myTreeview">
<local:TreeViewItemAdv Header="Employee1" ExpanderStyle="{DynamicResource MyEStyle}>
<local:TreeViewItemAdv Header="Jesper"/>
<local:TreeViewItemAdv Header="Aaberg"/>
<local:TreeViewItemAdv Header="12345"/>
</local:TreeViewItemAdv>
<local:TreeViewItemAdv Header="Employee2">
<local:TreeViewItemAdv Header="Dominik"/>
<local:TreeViewItemAdv Header="Paiha"/>
<local:TreeViewItemAdv Header="98765"/>
</local:TreeViewItemAdv>
</local:TreeViewAdv>
</StackPanel>
</Window>
See Also
FadeAnimation
Gets or sets the fade animation.
Declaration
public DoubleAnimation FadeAnimation { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.Animation.DoubleAnimation | The fade animation. |
FakeItemTemplate
Declaration
public DataTemplate FakeItemTemplate { get; set; }
Property Value
| Type |
|---|
| System.Windows.DataTemplate |
FakeItemTemplateSelector
Declaration
public DataTemplateSelector FakeItemTemplateSelector { get; set; }
Property Value
| Type |
|---|
| System.Windows.Controls.DataTemplateSelector |
HeaderTextDecorations
Gets or sets the header text decorations.
Declaration
public TextDecorationCollection HeaderTextDecorations { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.TextDecorationCollection | The header text decorations. |
ImageHeight
Gets or sets height to all images.
Declaration
public double ImageHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | Type: System.Double The height of the image. The default value is NaN. |
Examples
This example shows how to set ImageHeight property in XAML.
<Window x:Class="Sample1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Window1" Height="300" Width="300">
<StackPanel Name="stackPanel">
<local:TreeViewAdv Name="myTreeview">
<local:TreeViewItemAdv Header="Employee1" ImageHeight="10">
<local:TreeViewItemAdv Header="Jesper" ImageHeight="10"/>
</local:TreeViewItemAdv>
</local:TreeViewAdv>
</StackPanel>
</Window>
See Also
ImageStretch
Gets or sets stretch to all images.
Declaration
public Stretch ImageStretch { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.Stretch | Type: System.Double The stretch of the image. The default value is Uniform. |
Examples
This example shows how to set ImageStretch property in XAML.
<Window x:Class="Sample1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Window1" Height="300" Width="300">
<StackPanel Name="stackPanel">
<local:TreeViewAdv Name="myTreeview">
<local:TreeViewItemAdv Header="Employee1" ImageStretch="Fill">
<local:TreeViewItemAdv Header="Jesper" ImageStretch="Fill"/>
</local:TreeViewItemAdv>
</local:TreeViewAdv>
</StackPanel>
</Window>
See Also
ImageWidth
Gets or sets width to all images.
Declaration
public double ImageWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Double | Type: System.Double The width of the image. The default value is NaN. |
Examples
This example shows how to set ImageWidth property in XAML.
<Window x:Class="Sample1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Window1" Height="300" Width="300">
<StackPanel Name="stackPanel">
<local:TreeViewAdv Name="myTreeview">
<local:TreeViewItemAdv Header="Employee1" ImageWidth="10">
<local:TreeViewItemAdv Header="Jesper" ImageWidth="10"/>
</local:TreeViewItemAdv>
</local:TreeViewAdv>
</StackPanel>
</Window>
See Also
IsCustomToolTipEnabled
Gets or sets a value indicating whether this instance is custom tool tip enabled.
Declaration
public bool IsCustomToolTipEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
IsDraging
Gets or sets a value indicating whether a TreeViewItemAdv control is dragging
Declaration
public bool IsDraging { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean true if the TreeViewItemAdv is dragging otherwise, false. The default value is false. |
Remarks
When the IsDraging property value changes, the Selected event occurs.
Examples
This example shows how to set IsDraging property in C#.
using System.Windows;
using Syncfusion.Windows.Tools.Controls;
namespace Sample1
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
myTreeViewItem.IsDraging = true;
}
}
}
See Also
IsDragOver
Gets or sets a value indicating whether the dragging item is located over this element.
Declaration
public bool IsDragOver { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean true if the dragging item is located over this element; otherwise, false. A value indicating whether the dragging item is located over this element. |
Examples
The following example shows how to access the IsDragOver property in C#.
using System.Windows;
using Syncfusion.Windows.Tools.Controls;
namespace Sample1
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
bool bIsDragOver = myTreeViewItem.IsDragOver;
}
}
}
See Also
IsEditable
Gets or sets a value indicating whether will can edit header of the item.
Declaration
public bool IsEditable { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean true if the header of the item can be edit; otherwise, false. The default value is true. |
Examples
This example shows how to set IsEditable property in C#.
using System.Windows;
using Syncfusion.Windows.Tools.Controls;
namespace Sample1
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
myTreeViewItem.IsEditable = false;
}
}
}
This example shows how to set IsEditable property in XAML.
<Window x:Class="Sample1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Window1" Height="300" Width="300">
<StackPanel Name="stackPanel">
<local:TreeViewAdv Name="myTreeview">
<local:TreeViewItemAdv Header="Employee1" IsEditable="false">
<local:TreeViewItemAdv Header="Jesper"/>
<local:TreeViewItemAdv Header="Aaberg"/>
<local:TreeViewItemAdv Header="12345"/>
</local:TreeViewItemAdv>
<local:TreeViewItemAdv Header="Employee2">
<local:TreeViewItemAdv Header="Dominik"/>
<local:TreeViewItemAdv Header="Paiha"/>
<local:TreeViewItemAdv Header="98765"/>
</local:TreeViewItemAdv>
</local:TreeViewAdv>
</StackPanel>
</Window>
See Also
IsExpanded
Gets or sets a value indicating whether the nested items in a TreeViewItemAdv are expanded or collapsed.
Declaration
public bool IsExpanded { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean true if the nested items of a TreeViewItemAdv are visible; otherwise, false. The default value is false. |
Remarks
The appearance of the button that expands and collapses the TreeViewItemAdv changes when the TreeViewItemAdv is expanded or collapsed. When the IsExpanded property value changes from true to false, the Collapsed event occurs. Similarly, the Expanded event occurs when the IsExpanded property value changes from false to true.
Examples
This example shows how to set IsExpanded property in C#.
using System.Windows;
using Syncfusion.Windows.Tools.Controls;
namespace Sample1
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
myTreeViewItem.IsExpanded = true;
}
}
}
See Also
IsImageSourceFreeze
Gets or sets the ImageSource freeze.
Declaration
public bool IsImageSourceFreeze { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsInEditMode
Gets or sets a value indicating whether item is in edit mode.
Declaration
public bool IsInEditMode { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean true if the item is in edit mode edit; otherwise, false. The default value is false. |
Examples
The following example shows how to get the value of the IsInEditMode property in C#.
using System.Windows;
using Syncfusion.Windows.Tools.Controls;
namespace Sample1
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
bool isInEditMode = myTreeViewItem.IsInEditMode;
}
}
}
See Also
IsLoading
Get or Set the item is loading
Declaration
public bool IsLoading { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsLoadOnDemand
Get or Set Load on Demand
Declaration
public bool IsLoadOnDemand { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
IsReadOnly
Gets or sets a value indicating whether treeviewitem is read only.
Declaration
public bool IsReadOnly { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
IsSelected
Gets or sets a value indicating whether a TreeViewItemAdv control is selected.
Declaration
public bool IsSelected { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean true if the TreeViewItemAdv is selected; otherwise, false. The default value is false. |
Remarks
When the IsSelected property value changes, the Selected event occurs.
Examples
This example shows how to set IsSelected property in C#.
using System.Windows;
using Syncfusion.Windows.Tools.Controls;
namespace Sample1
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
myTreeViewItem.IsSelected = true;
}
}
}
See Also
IsSelectedFalse
Gets or sets a value indicating whether this instance is selected false.
Declaration
public bool IsSelectedFalse { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
|
IsSelectionActive
Gets a value indicating whether the TreeViewItemAdv has keyboard focus.
Declaration
public bool IsSelectionActive { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean true if the TreeViewItemAdv has keyboard focus; otherwise, false. The default value is false. |
Remarks
If the keyboard changes focus from a TreeViewItemAdv to a System.Windows.Controls.Menu or a System.Windows.Controls.ToolBar, the value of this property remains true.
Examples
The following example shows how to get the value of the IsSelectionActive property in C#.
bool isEmployee1Active = Employee1Data.IsSelectionActive;
See Also
IsShowToolTip
Gets a value indicating whether show tooltip.
Declaration
public bool IsShowToolTip { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean true if need shows the tooltip; otherwise, false. The default value is true. |
Remarks
In case when there is not enough space to display the entire item, it�s content displays help text in a tooltip above the item.
Examples
The following example shows how to get the value of the IsShowToolTip property in C#.
using System.Windows;
using Syncfusion.Windows.Tools.Controls;
namespace Sample1
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
bool show = myTreeViewItem.IsShowToolTip;
}
}
}
See Also
LeftImageSource
Gets or sets ImageSource to left image.
Declaration
public ImageSource LeftImageSource { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.ImageSource | Type: System.Windows.Media.ImageSource The source of the image. The default value is null. |
Examples
This example shows how to set LeftImageSource property in XAML.
<Window x:Class="Sample1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Window1" Height="300" Width="300">
<StackPanel Name="stackPanel">
<local:TreeViewAdv Name="myTreeview">
<local:TreeViewItemAdv Header="Employee1" LeftImageSource="images/image1.png">
<local:TreeViewItemAdv Header="Jesper" LeftImageSource="images/image2.png"/>
</local:TreeViewItemAdv>
</local:TreeViewAdv>
</StackPanel>
</Window>
See Also
LoadingHeader
header for loading content
Declaration
public object LoadingHeader { get; set; }
Property Value
| Type |
|---|
| System.Object |
LoadingHeaderTemplate
header template for loading content
Declaration
public DataTemplate LoadingHeaderTemplate { get; set; }
Property Value
| Type |
|---|
| System.Windows.DataTemplate |
MultiColumnEnable
Gets or sets a value indicating whether item is in MultiColumn mode.
Declaration
public bool MultiColumnEnable { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean true if the item displayed in MultiColumn mode; otherwise, false. The default value is false. |
Examples
This example shows how to set MultiColumnEnable property in C#.
using System.Windows;
using Syncfusion.Windows.Tools.Controls;
namespace Sample1
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
myTreeView.MultiColumnEnable = True;
}
}
}
This example shows how to set MultiColumnEnable property in XAML.
<Window x:Class="Sample1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Window1" Height="300" Width="300">
<StackPanel Name="stackPanel">
<local:TreeViewAdv Name="myTreeview" MultiColumnEnable="True">
<local:TreeViewItemAdv Header="2222">
<local:TreeViewItemAdv Header="3333"/>
<local:TreeViewItemAdv Header="3333"/>
<local:TreeViewItemAdv Header="3333"/>
<local:TreeViewItemAdv Header="3333"/>
</local:TreeViewItemAdv>
<local:TreeViewItemAdv Header="2222"/>
<local:TreeViewItemAdv Header="2222"/>
<local:TreeViewItemAdv Header="2222"/>
<local:TreeViewItemAdv Header="2222"/>
<snc:TreeViewAdv.Columns>
<local:TreeViewColumnCollection>
<local:TreeViewColumn Width="100" Header="1"
DisplayMemberBinding="{Binding Path=Header, RelativeSource={RelativeSource AncestorType={x:Type snc:TreeViewItemAdv}}}"/>
<local:TreeViewColumn Width="50" Header="BBB"
DisplayMemberBinding="{Binding Path=Header, RelativeSource={RelativeSource AncestorType={x:Type snc:TreeViewItemAdv}}}"/>
<local:TreeViewColumn Width="50" Header="CCC"
DisplayMemberBinding="{Binding Path=Header, RelativeSource={RelativeSource AncestorType={x:Type snc:TreeViewItemAdv}}}"/>
<local:TreeViewColumn Width="50" Header="DDD">
<local:TreeViewColumn.CellTemplate>
<DataTemplate>
<Border Margin="1" BorderBrush="Red" BorderThickness="1">
<TextBlock Text="{Binding Path=Header, RelativeSource={RelativeSource AncestorType={x:Type snc:TreeViewItemAdv}}}"/>
</Border>
</DataTemplate>
</local:TreeViewColumn.CellTemplate>
</local:TreeViewColumn>
</local:TreeViewColumnCollection>
</local:TreeViewAdv.Columns>
</local:TreeViewAdv>
</StackPanel>
</Window>
See Also
ParentItemsControl
Gets the parent items control.
Declaration
public ItemsControl ParentItemsControl { get; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Controls.ItemsControl | The parent items control. |
RightImageSource
Gets or sets ImageSource to right image.
Declaration
public ImageSource RightImageSource { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.ImageSource | Type: System.Windows.Media.ImageSource The source of the image. The default value is null. |
Examples
This example shows how to set RightImageSource property in XAML.
<Window x:Class="Sample1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Syncfusion.Windows.Tools.Controls;assembly=Syncfusion.Tools.WPF"
Title="Window1" Height="300" Width="300">
<StackPanel Name="stackPanel">
<local:TreeViewAdv Name="myTreeview">
<local:TreeViewItemAdv Header="Employee1" RightImageSource="images/image1.png">
<local:TreeViewItemAdv Header="Jesper" RightImageSource="images/image2.png"/>
</local:TreeViewItemAdv>
</local:TreeViewAdv>
</StackPanel>
</Window>
See Also
ShowRootLines
Gets a value indicating whether show root line for items.
Declaration
public bool ShowRootLines { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean | Type: System.Boolean true if root line is visible; otherwise, false. The default value is true. |
Remarks
Specifies whether lines should be shown near the top-level nodes.
Examples
This example shows how to set ShowRootLines property in C#.
using System.Windows;
using Syncfusion.Windows.Tools.Controls;
namespace Sample1
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
myTreeViewItem.ShowRootLines = false;
}
}
}
See Also
Sorting
Gets or sets the sorting.
Declaration
public SortDirection Sorting { get; set; }
Property Value
| Type | Description |
|---|---|
| SortDirection | The sorting. |
Methods
AddInCache(TreeViewItemAdv, Boolean)
Adds the in cache.
Declaration
protected void AddInCache(TreeViewItemAdv item, bool needToAdd)
Parameters
| Type | Name | Description |
|---|---|---|
| TreeViewItemAdv | item | The item. |
| System.Boolean | needToAdd | if set to |
ClearContainerForItemOverride(DependencyObject, Object)
When overridden in a derived class, undoes the effects of the System.Windows.Controls.ItemsControl.PrepareContainerForItemOverride(System.Windows.DependencyObject,System.Object) method.
Declaration
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyObject | element | The container element. |
| System.Object | item | The item. |
Dispose()
Declaration
public void Dispose()
GetContainerForItemOverride()
Creates or identifies the element that is used to display the given item.
Declaration
protected override DependencyObject GetContainerForItemOverride()
Returns
| Type | Description |
|---|---|
| System.Windows.DependencyObject | The element that is used to display the given item. |
GetItemsPanelType()
Gets the type of the items panel.
Declaration
protected virtual Type GetItemsPanelType()
Returns
| Type | Description |
|---|---|
| System.Type | Type of tree view items panel |
IsItemItsOwnContainerOverride(Object)
Determines if the specified item is (or is eligible to be) its own container.
Declaration
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | item | The item to check. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if the item is (or is eligible to be) its own container; otherwise, false. |
OnAfterItemEdit(RoutedEventArgs)
Raises the AfterItemEdit event.
Declaration
protected virtual void OnAfterItemEdit(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | The System.Windows.RoutedEventArgs instance containing the event data. |
OnApplyTemplate()
Builds the current template's visual tree if necessary.
Declaration
public override void OnApplyTemplate()
OnBeforeItemEdit(RoutedEventArgs)
Raises the BeforeItemEdit event.
Declaration
protected virtual void OnBeforeItemEdit(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | The System.Windows.RoutedEventArgs instance containing the event data. |
OnCollapsed(RoutedEventArgs)
Raises the Collapsed event.
Declaration
protected virtual void OnCollapsed(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | The System.Windows.RoutedEventArgs instance containing the event data. |
OnCreateAutomationPeer()
Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
| Type | Description |
|---|---|
| System.Windows.Automation.Peers.AutomationPeer | The type-specific AutomationPeer implementation. |
OnDragEnter(DragEventArgs)
Invoked when an unhandled DragDrop.DragEnter attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnDragEnter(DragEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DragEventArgs | e | The DragEventArgs that contains the event data. |
OnDragLeave(DragEventArgs)
Invoked when an unhandled DragDrop.DragLeave attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnDragLeave(DragEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DragEventArgs | e | The DragEventArgs that contains the event data. |
OnDragOver(DragEventArgs)
Invoked when an unhandled DragDrop.DragOver attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnDragOver(DragEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DragEventArgs | e | the event data. |
OnDrop(DragEventArgs)
Invoked when an unhandled DragDrop.DragEnter attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnDrop(DragEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DragEventArgs | e | The event data. |
OnEditKeyDown(RoutedEventArgs)
Raises the EditKeyDown event.
Declaration
protected virtual void OnEditKeyDown(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | The System.Windows.RoutedEventArgs instance containing the event data. |
OnEditKeyPress(RoutedEventArgs)
Raises the EditKeyPress event.
Declaration
protected virtual void OnEditKeyPress(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | The System.Windows.RoutedEventArgs instance containing the event data. |
OnEditKeyUp(RoutedEventArgs)
Raises the EditKeyUp event.
Declaration
protected virtual void OnEditKeyUp(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | The System.Windows.RoutedEventArgs instance containing the event data. |
OnExpanded(RoutedEventArgs)
Raises the Expanded event.
Declaration
protected virtual void OnExpanded(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | The System.Windows.RoutedEventArgs instance containing the event data. |
OnGotKeyboardFocus(KeyboardFocusChangedEventArgs)
Invoked when the KeyboardFocus event is received.
Declaration
protected override void OnGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyboardFocusChangedEventArgs | e | Information about the event. |
OnItemsChanged(NotifyCollectionChangedEventArgs)
Called when Items of the control is changed.
Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | The instance containing the event data. |
OnItemsSourceChanged(IEnumerable, IEnumerable)
Called when the ItemsSource property changes.
Declaration
protected override void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.IEnumerable | oldValue | Old value of the ItemsSource property. |
| System.Collections.IEnumerable | newValue | New value of the ItemsSource property. |
OnKeyDown(KeyEventArgs)
Invoked when to the KeyDown event is received.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyEventArgs | e | Information about the event. |
OnMouseEnter(MouseEventArgs)
Invoked when an unhandled Mouse. MouseEnter attached event is raised on this element. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseEventArgs | e | The MouseEventArgs that contains the event data. |
OnMouseLeave(MouseEventArgs)
Invoked when an unhandled Mouse.MouseLeave attached event is raised on this element. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseEventArgs | e | The MouseEventArgs that contains the event data. |
OnMouseLeftButtonDown(MouseButtonEventArgs)
Invoked when an unhandled MouseLeftButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The event data. |
OnMouseLeftButtonUp(MouseButtonEventArgs)
Invoked when an unhandled MouseLeftButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The event data |
OnMouseMove(MouseEventArgs)
Invoked when an unhandled Mouse.MouseMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseEventArgs | e | The MouseEventArgs that contains the event data. |
OnMouseRightButtonDown(MouseButtonEventArgs)
Invoked when an unhandled MouseRightButtonDown routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseRightButtonDown(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The event data. |
OnMouseRightButtonUp(MouseButtonEventArgs)
Invoked when an unhandled MouseRightButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnMouseRightButtonUp(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The event data |
OnPreviewMouseLeftButtonDown(MouseButtonEventArgs)
Invoked when an unhandled PreviewMouseLeftButtonDown routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was pressed. |
OnPreviewMouseLeftButtonUp(MouseButtonEventArgs)
Invoked when an unhandled PreviewMouseLeftButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnPreviewMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was pressed. |
OnPreviewMouseRightButtonDown(MouseButtonEventArgs)
Invoked when an unhandled PreviewMouseRightButtonDown routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnPreviewMouseRightButtonDown(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The MouseButtonEventArgs that contains the event data. The event data reports that the right mouse button was pressed. |
OnPreviewMouseRightButtonUp(MouseButtonEventArgs)
Invoked when an unhandled PreviewMouseRightButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Declaration
protected override void OnPreviewMouseRightButtonUp(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was pressed. |
OnPreviewTouchDown(TouchEventArgs)
Declaration
protected override void OnPreviewTouchDown(TouchEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.TouchEventArgs | e |
OnPreviewTouchUp(TouchEventArgs)
Declaration
protected override void OnPreviewTouchUp(TouchEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.TouchEventArgs | e |
OnPropertyChanged(DependencyPropertyChangedEventArgs)
Invoked whenever the effective value of any dependency property on this System.Windows.FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter. Overrides System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs).
Declaration
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyPropertyChangedEventArgs | e | The event data that describes the property that changed, as well as old and new values. |
OnSelected(RoutedEventArgs)
Raises the Selected event.
Declaration
protected virtual void OnSelected(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | The System.Windows.RoutedEventArgs instance containing the event data. |
OnTouchDown(TouchEventArgs)
Declaration
protected override void OnTouchDown(TouchEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.TouchEventArgs | e |
OnTouchUp(TouchEventArgs)
Declaration
protected override void OnTouchUp(TouchEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.TouchEventArgs | e |
OnUnselected(RoutedEventArgs)
Raises the Unselected event.
Declaration
protected virtual void OnUnselected(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | The System.Windows.RoutedEventArgs instance containing the event data. |
OnVisualParentChanged(DependencyObject)
Invoked when the parent of this element in the visual tree is changed. Overrides System.Windows.UIElement.OnVisualParentChanged(System.Windows.DependencyObject).
Declaration
protected override void OnVisualParentChanged(DependencyObject oldParent)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyObject | oldParent | The old parent element. May be null to indicate that the element did not have a visual parent previously. |
PrepareContainerForItemOverride(DependencyObject, Object)
Prepares the specified element to display the specified item.
Declaration
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DependencyObject | element | Element used to display the specified item. |
| System.Object | item | Specified item. |
SortTreeViewItem()
Sorts the tree view.
Declaration
public void SortTreeViewItem()
ToString()
Returns a String that represents the current Object.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | A String that represents the current Object. |
Events
AfterItemEdit
Occurs when the IsInEditMode property changes.
Declaration
public event EditModeChangeHandler AfterItemEdit
Event Type
| Type | Description |
|---|---|
| EditModeChangeHandler | Type: EditModeChangeHandler This event raise after the edit operations are completed. |
Examples
The following example shows how to assign an event handler for the AfterItemEdit event to a TreeViewItemAdv, and how to define the event handler in the code-behind.
<TreeViewItem Header="Employee2"
Name="Employee2Data">
<TreeViewItem Header="Work Days"
Name="emp2WorkDays"
AfterItemEdit="TreeViewItemAdv_AfterItemEdit"
BeforeItemEdit="TreeViewItemAdv_BeforeItemEdit">
<TreeViewItem Header="Monday" />
<TreeViewItem Header="Wednesday"/>
</TreeViewItem>
</TreeViewItem>
private void TreeViewItemAdv_AfterItemEdit( object sender, EditModeChangeEventArgs e )
{
Debug.WriteLine( "AfterItemEdit: old( " + e.OldValue + "), new( " + e.NewValue + ")" );
}
private void TreeViewItemAdv_BeforeItemEdit( object sender, EditModeChangeEventArgs e )
{
Debug.WriteLine( "BeforeItemEdit: old( " + e.OldValue + "), new( " + e.NewValue + ")" );
}
See Also
BeforeItemEdit
Occurs when the IsInEditMode property changes.
Declaration
public event EditModeChangeHandler BeforeItemEdit
Event Type
| Type | Description |
|---|---|
| EditModeChangeHandler | Type: EditModeChangeHandler This event raise before the TreeViewItemAdv enters the edit mode. |
Examples
The following example shows how to assign an event handler for the BeforeItemEdit event to a TreeViewItemAdv, and how to define the event handler in the code-behind.
<TreeViewItem Header="Employee2"
Name="Employee2Data">
<TreeViewItem Header="Work Days"
Name="emp2WorkDays"
AfterItemEdit="TreeViewItemAdv_AfterItemEdit"
BeforeItemEdit="TreeViewItemAdv_BeforeItemEdit">
<TreeViewItem Header="Monday" />
<TreeViewItem Header="Wednesday"/>
</TreeViewItem>
</TreeViewItem>
private void TreeViewItemAdv_AfterItemEdit( object sender, EditModeChangeEventArgs e )
{
Debug.WriteLine( "AfterItemEdit: old( " + e.OldValue + "), new( " + e.NewValue + ")" );
}
private void TreeViewItemAdv_BeforeItemEdit( object sender, EditModeChangeEventArgs e )
{
Debug.WriteLine( "BeforeItemEdit: old( " + e.OldValue + "), new( " + e.NewValue + ")" );
}
See Also
Collapsed
Occurs when the IsExpanded property changes from true to false.
Declaration
public event RoutedEventHandler Collapsed
Event Type
| Type | Description |
|---|---|
| System.Windows.RoutedEventHandler | Type: System.Windows.RoutedEventHandler This event occurs when a TreeViewItemAdv is collapsed so that child elements are hidden. |
Examples
The following example shows how to assign an event handler for the Collapsed event to a TreeViewItemAdv, and how to define the event handler in code.
<TreeViewItemAdv Header="Employee1"
Name="Employee1Data"
IsExpanded="True"
Collapsed="OnCollapsed"
Expanded="OnExpanded">
<TreeViewItemAdv Header="Work Days"
Name="EmployeeWorkDays"
IsSelected="True">
<TreeViewItemAdv Header="Tuesday" />
<TreeViewItemAdv Header="Friday"/>
</TreeViewItemAdv>
</TreeViewItemAdv>
<TreeViewItemAdv Header="Employee2"
Name="Employee2Data">
<TreeViewItemAdv Header="Work Days"
Name="emp2WorkDays"
Selected="GetSchedule"
Unselected="SetSchedule">
<TreeViewItemAdv Header="Monday" />
<TreeViewItemAdv Header="Wednesday"/>
</TreeViewItemAdv>
</TreeViewItemAdv>
public void OnCollapsed(object sender, RoutedEventArgs e)
{
//Perform actions when the TreeViewItem is collapsed
}
See Also
EditKeyDown
Occurs when a key is pressed when the item is in edit mode.
Declaration
public event KeyEventHandler EditKeyDown
Event Type
| Type | Description |
|---|---|
| System.Windows.Input.KeyEventHandler | Type: System.Windows.Input.KeyEventHandler This event raise when the item is in edit mode. |
Examples
The following example shows how to assign an event handler for the EditKeyDown event to a TreeViewItemAdv, and how to define the event handler in the code-behind.
<TreeViewItem Header="Employee2"
Name="Employee2Data">
<TreeViewItem Header="Work Days"
Name="emp2WorkDays"
EditKeyDown="TreeViewItemAdv_EditKeyDown"
EditKeyUp="TreeViewItemAdv_EditKeyUp">
<TreeViewItem Header="Monday" />
<TreeViewItem Header="Wednesday"/>
</TreeViewItem>
</TreeViewItem>
private void TreeViewItemAdv_EditKeyDown( object sender, KeyEventArgs e )
{
Debug.WriteLine( "Down: " + e.Key );
}
private void TreeViewItemAdv_EditKeyUp( object sender, KeyEventArgs e )
{
Debug.WriteLine( "Up: " + e.Key );
}
See Also
EditKeyUp
Occurs when a key is released when the item is in edit mode.
Declaration
public event KeyEventHandler EditKeyUp
Event Type
| Type | Description |
|---|---|
| System.Windows.Input.KeyEventHandler | Type: System.Windows.Input.KeyEventHandler This event raise when the item is in edit mode. |
Examples
The following example shows how to assign an event handler for the EditKeyUp event to a TreeViewItemAdv, and how to define the event handler in the code-behind.
<TreeViewItem Header="Employee2"
Name="Employee2Data">
<TreeViewItem Header="Work Days"
Name="emp2WorkDays"
EditKeyDown="TreeViewItemAdv_EditKeyDown"
EditKeyUp="TreeViewItemAdv_EditKeyUp">
<TreeViewItem Header="Monday" />
<TreeViewItem Header="Wednesday"/>
</TreeViewItem>
</TreeViewItem>
private void TreeViewItemAdv_EditKeyDown( object sender, KeyEventArgs e )
{
Debug.WriteLine( "Down: " + e.Key );
}
private void TreeViewItemAdv_EditKeyUp( object sender, KeyEventArgs e )
{
Debug.WriteLine( "Up: " + e.Key );
}
See Also
Expanded
Occurs when the IsExpanded property changes from true to false.
Declaration
public event RoutedEventHandler Expanded
Event Type
| Type | Description |
|---|---|
| System.Windows.RoutedEventHandler | Type: System.Windows.RoutedEventHandler This event occurs when a TreeViewItemAdv is collapsed so that child elements are hidden. |
Examples
The following example shows how to assign an event handler for the Expanded event to a TreeViewItemAdv and how to define the event handler in the code-behind.
<TreeViewItemAdv Header="Employee1"
Name="Employee1Data"
IsExpanded="True"
Collapsed="OnCollapsed"
Expanded="OnExpanded">
<TreeViewItemAdv Header="Work Days"
Name="EmployeeWorkDays"
IsSelected="True">
<TreeViewItemAdv Header="Tuesday" />
<TreeViewItemAdv Header="Friday"/>
</TreeViewItemAdv>
</TreeViewItemAdv>
<TreeViewItemAdv Header="Employee2"
Name="Employee2Data">
<TreeViewItemAdv Header="Work Days"
Name="emp2WorkDays"
Selected="GetSchedule"
Unselected="SetSchedule">
<TreeViewItemAdv Header="Monday" />
<TreeViewItemAdv Header="Wednesday"/>
</TreeViewItemAdv>
</TreeViewItemAdv>
public void OnExpanded(object sender, RoutedEventArgs e)
{
//Perform actions when the TreeViewItem is collapsed
}
See Also
Selected
Occurs when the IsExpanded property changes from true to false.
Declaration
public event RoutedEventHandler Selected
Event Type
| Type | Description |
|---|---|
| System.Windows.RoutedEventHandler | Type: System.Windows.RoutedEventHandler The event occurs when a TreeViewItemAdv becomes the selected TreeViewItemAdv in a System.Windows.Controls.TreeView control. This event is related to the System.Windows.Controls.TreeView.SelectedItemChangedEvent event that occurs when there is a change in the System.Windows.Controls.TreeView.SelectedItemProperty property of a TreeViewAdv control. |
Examples
The following example shows how to assign an event handler for the Selected event to a TreeViewItemAdv, and how to define the event handler in the code-behind.
<TreeViewItem Header="Employee2"
Name="Employee2Data">
<TreeViewItem Header="Work Days"
Name="emp2WorkDays"
Selected="GetSchedule"
Unselected="SetSchedule">
<TreeViewItem Header="Monday" />
<TreeViewItem Header="Wednesday"/>
</TreeViewItem>
</TreeViewItem>
public void GetSchedule(object sender, RoutedEventArgs e)
{
//Perform actions when a TreeViewItem
//controls is selected
}
See Also
Unselected
Occurs when the IsExpanded property changes from true to false.
Declaration
public event RoutedEventHandler Unselected
Event Type
| Type | Description |
|---|---|
| System.Windows.RoutedEventHandler | Type: System.Windows.RoutedEventHandler The event occurs when the selection changes from this TreeViewItemAdv to another TreeViewItemAdv in a TreeViewAdv control. This event is related to the System.Windows.Controls.TreeView.SelectedItemChangedEvent event that occurs when there is a change in the System.Windows.Controls.TreeView.SelectedItemProperty property of a TreeViewAdv control. |
Examples
The following example shows how to assign an event handler for the Selected event to a TreeViewItemAdv, and how to define the event handler in the code-behind.
<TreeViewItem Header="Employee2"
Name="Employee2Data">
<TreeViewItem Header="Work Days"
Name="emp2WorkDays"
Selected="GetSchedule"
Unselected="SetSchedule">
<TreeViewItem Header="Monday" />
<TreeViewItem Header="Wednesday"/>
</TreeViewItem>
</TreeViewItem>
public void SetSchedule(object sender, RoutedEventArgs e)
{
//Perform actions when a TreeViewItem
//control becomes unselected
}
See Also
Explicit Interface Implementations
ICloneable.Clone()
Creates a new object that is a copy of the current instance.
Declaration
object ICloneable.Clone()
Returns
| Type | Description |
|---|---|
| System.Object | A new object that is a copy of this instance. |