Skip to main content

PopupBaseEdit.PopupContentTemplate Property

Gets or sets the template that defines the presentation of the popup window’s content. This is a dependency property.

Namespace: DevExpress.Xpf.Editors

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

NuGet Package: DevExpress.Wpf.Core

Declaration

public ControlTemplate PopupContentTemplate { get; set; }

Property Value

Type Description
ControlTemplate

A ControlTemplate object that represents the template of the popup window’s content.

Remarks

The PopupContentTemplate property allows you to specify the popup window content.

Use the PopupElement property to get the control placed to the popup window (for example, for the PopupCalcEdit, the PopupElement property returns a Calculator). The PopupRoot allows you to get a root element within the popup.

Set the AllowRecreatePopupContent property to true to recreate the popup content each time the editor displays its popup.

Example

This example shows how to customize the GridControl displayed in the LookUpEdit‘s popup window.

  1. Set the LookUpEdit.AutoPopulateColumns property to false.
  2. Use the PopupBaseEdit.PopupContentTemplate property to specify a custom GridControl.
  3. Set the GridControl‘s name to PART_GridControl.

LookUpEdit - Customize the GridControl

View Example: LookUpEdit - Customize the Embedded GridControl

<dxg:LookUpEdit Name="lookUpEdit1"
                DisplayMember="ProductName"
                ValueMember="ID"
                AutoPopulateColumns="False"
                AutoComplete="True"
                IncrementalFiltering="True"
                ImmediatePopup="True"
                IsPopupAutoWidth="False">
    <dxg:LookUpEdit.PopupContentTemplate>
        <ControlTemplate>
            <dxg:GridControl Name="PART_GridControl">
                <dxg:GridControl.Columns>
                    <dxg:GridColumn FieldName="ProductName"/>
                    <dxg:GridColumn FieldName="UnitPrice"/>
                    <dxg:GridColumn FieldName="Quantity"/>
                </dxg:GridControl.Columns>
                <dxg:GridControl.View>
                    <dxg:TableView AutoWidth="True"/>
                </dxg:GridControl.View>
            </dxg:GridControl>
        </ControlTemplate>
    </dxg:LookUpEdit.PopupContentTemplate>
</dxg:LookUpEdit>
using System.Windows;

namespace HowToCreateLookUpEdit {
    public partial class MainWindow : Window {
        public MainWindow() {
            InitializeComponent();
            lookUpEdit1.ItemsSource = new ProductList();
        }
    }
}

The following code snippets (auto-collected from DevExpress Examples) contain references to the PopupContentTemplate 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