Back to Devexpress

AutoSuggestEdit.ItemTemplate Property

wpf-devexpress-dot-xpf-dot-editors-dot-autosuggestedit-c2851fbd.md

latest2.3 KB
Original Source

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

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public DataTemplate ItemTemplate { get; set; }
vb
Public Property ItemTemplate As DataTemplate

Property Value

TypeDescription
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

xaml
<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

ItemTemplateSelector

AutoSuggestEdit Class

AutoSuggestEdit Members

DevExpress.Xpf.Editors Namespace