Intersoft ClientUI Documentation
ItemEditTemplate Property (UXTreeView)



Gets or sets a value that indicates the item edit template for UXTreeViewItem.
Syntax
<CategoryAttribute("Common Properties")>
Public Property ItemEditTemplate As DataTemplate
Dim instance As UXTreeView
Dim value As DataTemplate
 
instance.ItemEditTemplate = value
 
value = instance.ItemEditTemplate
[CategoryAttribute("Common Properties")]
public DataTemplate ItemEditTemplate {get; set;}
[CategoryAttribute("Common Properties")]
public:
property DataTemplate^ ItemEditTemplate {
   DataTemplate^ get();
   void set (    DataTemplate^ value);
}
Remarks

UXTreeView features built-in editing capability which can be easily enabled by setting the IsEditable property to true. When enabled, users can press the F2 key on the selected item to activate editing mode. By default, UXTextBox control will be used as the editing control.

If you prefer, you can also customize the editing control to use more advanced editing controls such as UXNumericUpDown by customizing the ItemEditTemplate property. To show the edited text/value properly, you must bind the property to the control you defined in the ItemEditTemplate property.

Example

The following code shows how to customize the editing controls in UXTreeView by setting a custom data template to the ItemEditTemplate.

XAML
Copy Code
<Grid>
    <Intersoft:UXTreeView x:Name="EmployeeTrees" TreeSelectionMode="Multiple" ItemsSource="{Binding Employees}" 
                             DisplayMemberPath="Name" CollectionMemberPath="Employees" IsEditable="True">
        <Intersoft:UXTreeView.ItemEditTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <Intersoft:UXTextBox Text="{Binding Name, Mode=TwoWay}" />
                    <TextBlock Text="|" />
                    <Intersoft:UXTextBox Text="{Binding Age, Mode=TwoWay}" />
                </StackPanel>
            </DataTemplate>
        </Intersoft:UXTreeView.ItemEditTemplate>
        <Intersoft:UXTreeView.ItemContainerStyle>
            <Style TargetType="Intersoft:UXTreeViewItem">
                <Setter Property="CollectionMemberPath" Value="Employees" />
                <Setter Property="DisplayMemberPath" Value="Name" />
            </Style>
        </Intersoft:UXTreeView.ItemContainerStyle>
    </Intersoft:UXTreeView>
</Grid>
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

UXTreeView Class
UXTreeView Members

Send Feedback