A newer version of this page is available. Switch to the current version.

TextEditBase.EditNonEditableTemplate Property

Gets or sets a template that defines the editor's presentation when the editor's text field is not editable. This is a dependency property.

Namespace: DevExpress.Xpf.Editors

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


public ControlTemplate EditNonEditableTemplate { get; set; }

Property Value

Type Description

A ControlTemplate object representing the editor's template.


The EditNonEditableTemplate property is in effect for the ButtonEdit editor and its derived editors (such as the ComboBoxEdit).

The template, specified via the EditNonEditableTemplate property, is applied to the editor's text field when the ButtonEdit.IsTextEditable property is set to false. In this case, the editor's text field cannot be edited, and an end user can change the editor's value only by choosing a new value in editor's popup.

The EditNonEditableTemplate property is not used when the editor is in in-place inactive mode (e.g., when an editor is used in a GridControl cell and this cell is not activated).

EditNonEditableTemplate's *DataContext depends on whether the editor is standalone or in-place. In both cases, use the BaseEdit.OwnerEdit attached property to bind to editor properties, for example:

        <TextBlock Text="{Binding (dxe:BaseEdit.OwnerEdit).EditValue}"/>


The following example shows how to customize the in-place combo box editor's appearance when its text field is not editable. In this example, in-place combo boxes are used to edit the 'Access Card Color' column field values. The appearance of the editors' items on the drop-down list is specified via the ItemTemplate property. As for the edit box, you can either apply the same template by setting the ApplyItemTemplateToSelectedItem property to true or specify another template using the EditNonEditableTemplate property (in this example, we used the second approach).

<Window x:Class="TextEdit_EditNonEditableTemplate.Window1"
        Title="Access Cards"

    <dxg:GridControl Name="gridControl1">
            <dxg:GridColumn FieldName="Name" />
            <dxg:GridColumn FieldName="CardColor" Header="Access Card Color">
                    <dxe:ComboBoxEditSettings IsTextEditable="False">
                                <Border Background="Transparent">
                                    <StackPanel Orientation="Horizontal">
                                        <Rectangle Width="10"
                                                   Fill="{Binding TargetNullValue=Transparent}"
                                                   RadiusY="2" />
                                        <TextBlock Text="{Binding}" />
                                <Rectangle Margin="2"
                                           Fill="{Binding EditValue, RelativeSource={RelativeSource TemplatedParent}}"
                                           RadiusY="2" />
            <dxg:TableView AutoWidth="True" />

See Also