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

how using MouseLeftButtonDown or like this

3 Answers 185 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dario Concilio
Top achievements
Rank 2
Dario Concilio asked on 20 Sep 2016, 03:09 PM

Hi to all,

I would using ComboBox in specific behavior:

I populate ItemSource with List<MyModel>, OK.

I have to use IsEditable, IsFilteringEnabled, TextSearchMode that allow me to search through items.

When I want to select an item, I click on it. (Selection item not must be automatic)

After that I'll clear selecteditem.

Can I do it?

I tryed with MouseLeftButtonDown  event but it doesn't fire.

3 Answers, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 21 Sep 2016, 02:44 PM
Hi Dario,

I am not sure I understand what you want to achieve completely.

Are you trying to clear the selected item after it's been selected with the mouse?

Could you please explain in more details your scenario and the steps you are having trouble with?

Regards,
Polya
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Dario Concilio
Top achievements
Rank 2
answered on 21 Sep 2016, 03:31 PM

I'm sorry,

I'm trying to explane with more details.

My goal is have a control as Simple Searcher.

The user wants to search particular item, but he don't remeber completly name, thus he try to write in "searcher box" a portion of name.

When app started, it has already populated the collection using MVVM pattern.

When he's typing into box, list dropdown appers and filters items.

He scroll through the items and click (he can only click) item searched.

At this point control clear textbox (of searcherbox) and close dropdown.

I think that I found solution, that's it.

In this way, it seems that SelectedItem not change until user click, in second time into setter of SelectedItem, it clear Text property of ComboBox

<telerik:RadComboBox x:Name="RicercaMenuRadComboBox"
                    ItemsSource="{Binding MenuItems}" SelectedItem="{Binding SelectedMenuItem,Mode=TwoWay}"
                    DisplayMemberPath="Header"
                    Style="{StaticResource RadComboBoxStyle}" OpenDropDownOnFocus="True"
                    TextSearchMode="Contains" CanAutocompleteSelectItems="False" CanKeyboardNavigationSelectItems="False"
                    IsFilteringEnabled="True"
                    ClearSelectionButtonVisibility="Collapsed"
                    IsEditable="True"
                    EmptyText="Cerca una voce nel menu"/

0
Polya
Telerik team
answered on 26 Sep 2016, 08:09 AM
Hello Dario,

We're happy that you've found a solution for your scenario.

Indeed, with the CanAutocompleteSelectItems and CanKeyboardNavigationSelectItems properties set to false you are disabling the ability of the user to select items using the keyboard or when typing in the text area of the RadComboBox. Thus, clicking with the mouse is the only available way left for performing selection.

If you have any other questions please write back.

Regards,
Polya
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
ComboBox
Asked by
Dario Concilio
Top achievements
Rank 2
Answers by
Polya
Telerik team
Dario Concilio
Top achievements
Rank 2
Share this question
or