Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.2.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