This is a migrated thread and some comments may be shown as answers.

how to select an item in combobox dropdownlist after filtering

1 Answer 242 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
JIG
Top achievements
Rank 1
JIG asked on 09 Jul 2019, 11:15 AM

Hi,

I enabled filtering on a radcombobox (see below for the xaml). 

When the combobox gets focus the dropdown opens. Next, when I type some characters in the combobox, the filter works correctly and narrows down the resultset to lets say 2 items. Next  I want to be able to click once on the second item in the filtered dropdownlist and pass it on (i.e. it will be used to highlight it in a radtreeview). What happens now is that the first click will just set selecteditem to the clicked item and show it in the combobox. I need to enter (so a second user input) to pass it on.

Is it possible to directly select and pass on an item from a filtered set of items with just one click? One option I considered is using a previewMouseDown event, which is hit after just one click, but than the top item in the filtered list is passed on as selecteditem, even though I clicked on the second item. 

<telerik:RadComboBox  IsEditable="True"  IsFilteringEnabled="True" IsTextSearchEnabled="True" TextSearchMode="Contains" StaysOpenOnEdit="True" OpenDropDownOnFocus="True" ItemsSource="{Binding Locations}" DisplayMemberPath="Description"    KeyDown="CboSearchLoc_KeyDown>

Thanks,

Maarten

 

 

1 Answer, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 11 Jul 2019, 12:14 PM
Hi JIG,

Could you please elaborate on what you mean by "pass on" the combobox item? Should the text of the combo be cleared and the item removed from the ItemsSource? Would you also specify whether you've defined any custom logic for the Enter key as it does not have any action at my end?

To make things more specific, I'v providing a small sample project with a RadComboBox which has filtering enabled as in the code snippet you provided. Can you please have a look at it and describe the behavior you wish to achieve using this project as an example? You can make any modifications you find necessary and send the project back to me, should you find this necessary.

Thank you in advance for your cooperation on the matter. I will be awaiting your reply.

Regards,
Dilyan Traykov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ComboBox
Asked by
JIG
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Share this question
or