Jaime Oro
Jaime Oro

Reputation: 10145

Is AutoComplete working on WPF?

I've a TextBox, can I autocomplete using 5 options that I've in a List?

It would be great if this could be done using Binding and XAML.

Upvotes: 4

Views: 443

Answers (1)

Anvaka
Anvaka

Reputation: 15823

There is no standard auto complete control in WPF. You can google for 3rd parties. But there is one very easy way to create simplistic auto complete control by slightly adjusting an editable ComboBox template:

<ComboBox IsEditable="True">
  <ComboBox.Template>
    <ControlTemplate TargetType="{x:Type ComboBox}">
      <TextBox x:Name="PART_EditableTextBox" />
    </ControlTemplate>
  </ComboBox.Template>
  <TextBlock Text="Hello"/>
  <TextBlock Text="World"/>
</ComboBox>     

Upvotes: 10

Related Questions