-1

I'm using Telerik RadAutoCompleteBox

<telerik:RadAutoCompleteBox x:Name="autoComleteBox"  Width="200"
                        ItemsSource="{Binding Countries}"
                        DisplayMemberPath="Name" 
                        AutoCompleteMode="Suggest"/>

The result is:

enter image description here

What I want to do is how can I display more detail about country, ( Lets say line display country name and another line to display country code ) Like:

enter image description here

Nathan Griffiths
  • 12,277
  • 2
  • 34
  • 51
Abdulsalam Elsharif
  • 4,773
  • 7
  • 32
  • 66

1 Answers1

1

Define a DropDownItemTemplate:

<telerik:RadAutoCompleteBox x:Name="autoComleteBox"  Width="200"
                        ItemsSource="{Binding Countries}"
                        DisplayMemberPath="Name" 
                        AutoCompleteMode="Suggest">
    <telerik:RadAutoCompleteBox.DropDownItemTemplate>
        <DataTemplate>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <TextBlock Text="ID:" />
                <TextBlock Text="Name:" Grid.Row="1" />
                <TextBlock Text="RSS Url:" Grid.Row="2" />

                <TextBlock Text="{Binding Id}" Grid.Column="1" />
                <TextBlock Text="{Binding Name}" Grid.Row="1" Grid.Column="1" />
                <TextBlock Text="{Binding Url}" Grid.Row="2" Grid.Column="1" />
            </Grid>
        </DataTemplate>
    </telerik:RadAutoCompleteBox.DropDownItemTemplate>
</telerik:RadAutoCompleteBox>
mm8
  • 163,881
  • 10
  • 57
  • 88
  • That's what you said here too and then you simply ignored the answer and my comments: http://stackoverflow.com/questions/43155756/printing-image-displayed-in-wpf-picture-box. Also, there is not much to check. This is how you customize the appearance of the drop down items. You could just copy my sample code. – mm8 Apr 21 '17 at 07:10