how using MouseLeftButtonDown or like this

4 posts, 0 answers
  1. Dario Concilio
    Dario Concilio avatar
    128 posts
    Member since:
    Apr 2016

    Posted 20 Sep Link to this post

    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.

  2. Polya
    Admin
    Polya avatar
    199 posts

    Posted 21 Sep Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dario Concilio
    Dario Concilio avatar
    128 posts
    Member since:
    Apr 2016

    Posted 21 Sep in reply to Polya Link to this post

    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"/

  5. Polya
    Admin
    Polya avatar
    199 posts

    Posted 26 Sep Link to this post

    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.
Back to Top