Back to Devexpress

TreeViewControl.NodeContentEditTemplate Property

wpf-devexpress-dot-xpf-dot-grid-dot-treeviewcontrol-a2c35681.md

latest4.4 KB
Original Source

TreeViewControl.NodeContentEditTemplate Property

Gets or sets a template that displays a custom editor used to edit node values. This is a dependency property.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public DataTemplate NodeContentEditTemplate { get; set; }
vb
Public Property NodeContentEditTemplate As DataTemplate

Property Value

TypeDescription
DataTemplate

The template that displays a custom editor. The template’s data context is an EditGridCellData object.

|

Remarks

You can use separate in-place editors to display and edit data. The TreeViewControl includes templates that allow you to define editors that display (when the control is in browse mode) and edit (when the control is in edit mode) node values:

TemplateDescription
NodeContentDisplayTemplateThe template that displays node values.
NodeContentEditTemplateThe template that displays an editor used to edit node values.

Specify the NodeContentTemplate property if you want to use the same template to display and edit data.

Example

The following code sample uses the ButtonEdit to add a delete button to a node’s editor:

xaml
<dxg:TreeViewControl ...
                     AllowEditing="True">
    <dxg:TreeViewControl.NodeContentEditTemplate>
        <DataTemplate>
            <dxe:ButtonEdit Name="PART_Editor" AllowDefaultButton="False">
                <dxe:ButtonEdit.Buttons>
                    <dxe:DeleteButtonInfo IsDefaultButton="True" />
                </dxe:ButtonEdit.Buttons>
            </dxe:ButtonEdit>
        </DataTemplate>
    </dxg:TreeViewControl.NodeContentEditTemplate>
</dxg:TreeViewControl>

If you have more than one editor template, use the NodeContentEditTemplateSelector property to implement custom logic to choose the required template.

Tip

See Also

NodeContentDisplayTemplate

NodeContentTemplate

NodeTemplate

TreeViewControl Class

TreeViewControl Members

DevExpress.Xpf.Grid Namespace