Note that there are some explanatory texts on larger screens.

plurals
  1. POStrange issues with drop down list of Combobox
    primarykey
    data
    text
    <p>Once again I can't find a neat solution for a simple UI problem in WPF. I want the combo box drop down list to appear whenever combo box gets focus. So I wrote this in the got focus event:</p> <pre><code> private void comboBoxAC_Cat_GotFocus(object sender, RoutedEventArgs e) { comboBoxAC_Cat.IsDropDownOpen = true; } </code></pre> <p>But now the problem is that once the drop down list opens, the application is kind of stuck in it. It can not come out of the drop down list no matter what I do, whether I press enter or anything. I tried registering to lost focus or other events but nothing seems to work. Here is a list of my event handlers in the application which become useless once I get inside the drop down list.</p> <pre><code>private void Grid_PreviewKeyDown(object sender, KeyEventArgs e) { var uie = e.OriginalSource as UIElement; if (e.Source is Button) return; if (e.Key == Key.Enter) { e.Handled = true; uie.MoveFocus( new TraversalRequrest( FocusNavigationDiection.Next)); } } private void comboBoxAC_Cat_LostFocus(object sender, RoutedEventArgs e) { (sender as ComboBox).IsDropDownOpen = false; } </code></pre> <p>Can any one help me out with this please? </p> <p>My Basic requirement is simple: Drop Down list should open as soon as Combobox is focused using tab or mouse. Then the user should be able to select the items and once he presses enter selecting a item from drop down list, it should close and focus should move to next ui element. </p> <p>Now is it hard to achieve??? I thought that was exactly the functionality of a combobox</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload