Reputation: 2427
I have a combo box in my application and when the drop down is open I would like the user to be able to type a letter and have the drop down skip to that selection. Currently it doesn't skip to the selection. I looked up couple of stackoverflow questions and applied the changes mentioned by them
IsTextSearchEnabled="True" TextSearch.TextPath="{Binding Name}"
WPF ComboBox using shortcut keys for selecting items
How to select item by typing a keyboard letter key in WPF combobox?
<ComboBox x:Name="serviceSelection" Grid.Row="0" Grid.Column="1"
IsTextSearchEnabled="True"
TextSearch.TextPath="{Binding Name}"
VerticalAlignment="Top"
Height="25"
HorizontalAlignment="Right"
Width="210"
ItemsSource="{Binding ServiceRootNodes}"
SelectionChanged="ServiceSelection_SelectionChanged"
SelectedIndex="0">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
Can someone provide me suggestions/feedback on what am i doing wrong ? Also in which cases does comboxBox letter search doesn't work?
Upvotes: 1
Views: 2623
Reputation: 21
Try giving the property name instead of binding
TextSearch.TextPath="Name"
Upvotes: 2
Reputation: 2283
This is what can help you get what you are looking for. http://social.msdn.microsoft.com/Forums/en-US/be860e67-c314-4a14-9e01-3bf948429ec0/combobox-first-letter-search
Upvotes: 0