Skip to main content

AutoSuggestEdit.ItemTemplate Property

Gets or sets a template that defines the presentation of items contained within the drop-down list. This is a dependency property.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v24.1.dll

NuGet Package: DevExpress.Wpf.Core

Declaration

public DataTemplate ItemTemplate { get; set; }

Property Value

Type Description
DataTemplate

A DataTemplate object that represents the template which defines the presentation of items contained within the drop-down list.

Remarks

You can apply different templates to editor’s drop-down items using a custom logic implemented in the ItemTemplateSelector.

Example

<dxe:AutoSuggestEdit 
    TextMember="City"
    DisplayMember="City"
    QuerySubmitted="AutoSuggestEdit_QuerySubmitted">
    <dxe:AutoSuggestEdit.ItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal" >
                <TextBlock Text="City:" Width="30"/>
                <TextBlock Text="{Binding City}" Width="100"/>
                <TextBlock Text="Customer:" Width="60" HorizontalAlignment="Right"/>
                <TextBlock Text="{Binding Name}" Width="120"/>
            </StackPanel>
        </DataTemplate>
    </dxe:AutoSuggestEdit.ItemTemplate>
</dxe:AutoSuggestEdit>

See Also