Skip to main content
A newer version of this page is available. .

BaseEdit.EditTemplate Property

Gets or sets a template that defines the editor’s presentation in edit mode. This is a dependency property.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v21.2.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

[Browsable(false)]
public ControlTemplate EditTemplate { get; set; }

Property Value

Type Description
ControlTemplate

A ControlTemplate object representing the editor’s template.

Remarks

Standalone Editor

A standalone editor is always in edit mode. Setting the BaseEdit.DisplayTemplate property has no effect. To customize the editor’s presentation, use the EditTemplate property.

In-Place Editor

If the editor is used inplace within a container control (e.g. the grid), its mode depends on whether its owning cell is edited. If a cell is edited, its editor is in edit inplace mode. Otherwise, it is in display mode.

To customize the editor’s presentation, create the corresponding templates (display and/or edit template) and assign them to the BaseEdit.DisplayTemplate and BaseEdit.EditTemplate properties.

Refer to the Assign Editors to Cells topic for more information.

A template that represents the editor’s border can be specified using the BaseEdit.BorderTemplate property.

Example

The following example customizes the visual appearance of a standalone editor.

View Example

<Window ...
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxet="http://schemas.devexpress.com/winfx/2008/xaml/editors/themekeys"
    xmlns:dxi="http://schemas.devexpress.com/winfx/2008/xaml/core/internal">
    <dxe:TextEdit Width="130" HorizontalAlignment="Center"
                  VerticalAlignment="Center" EditValue="USA" ShowBorder="False">
        <dxe:TextEdit.EditTemplate>
            <ControlTemplate>
                <Border BorderBrush="Orange" BorderThickness="3" CornerRadius="7">
                    <DockPanel>
                        <TextBlock Margin="2" VerticalAlignment="Center" Foreground="Gray" Text="Country:" />
                        <TextBox Name="PART_Editor" Margin="2"
                                 Style="{dxi:ThemeResource {dxet:TextEditThemeKey ResourceKey=TextStyle}}" />
                    </DockPanel>
                </Border>
            </ControlTemplate>
        </dxe:TextEdit.EditTemplate>
    </dxe:TextEdit>
</Window>

WPF TextEdit - EditTemplate Example

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the EditTemplate property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also