Enter key, Autocomplete, keyboard nav and SelectionChanged

4 posts, 0 answers
  1. Brian
    Brian avatar
    18 posts
    Member since:
    Feb 2010

    Posted 16 Apr 2010 Link to this post

    The combo dropdown opening on PageDown is fine. Having the enter key select the item is an issue because we have default buttons on all of our pages. The buttons fire when the enter key is pressed in the dropdown. If I could stop that I guess that would fix my issue. If I set CanKeyboardNavigationSelectItems to true then the user can tab off the control after selecting an item instead of pressing enter. However the selection changed event is fired everytime they arrow down or up in the dropdown. In the selection handler I can check if the dropdown is open but it is always open until they tab off and at that point the event doesn't fire anymore.

    I guess what I really want is tab off to work the same way as the enter key and that is to select the currently highlighted item in the dropdown. Or don't route the enter key event further than the combobox when the dropdown is open and enter is pressed.
  2. Brian
    Brian avatar
    18 posts
    Member since:
    Feb 2010

    Posted 16 Apr 2010 Link to this post

    Update. I looked at our pages with the button firing on the enter key and we are actually handling the keyup event at a parent of the combobox which is a StackPanel. I can look at the OriginalSource and just return if it is a RadComboxBox. I guess this is really not an issue although it would be nice to have tab off make the currently highlighted item in the dropdown the selected item.
  3. DevCraft banner
  4. Brian
    Brian avatar
    18 posts
    Member since:
    Feb 2010

    Posted 16 Apr 2010 Link to this post

    This is still an issue. Perhaps someone has a workaround suggestion. The issue with changing the keyup handler in either the parent StackPanel or the RadComboBox itself to just return if the OriginalSource is RadComboBox won't work because if the focus happens to be on a RadComboBox whether the dropdown is open or closed when enter is pressed then our default enter key event won't fire. By the time I get the keyup event the dropdown is already closed so I can't use code like this either:

            void StakeholderSearchStackPanel_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)  
            {  
                  
                if ((e.Key.ToString() == "Enter") && (SearchButton.IsEnabled == true))  
                {  
     
                    if (e.OriginalSource is RadComboBox && ((RadComboBox)e.OriginalSource).IsDropDownOpen)  
                        return;  
     
                    SearchEventAction();  
                }  
            }  
     


  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 22 Apr 2010 Link to this post

    Hi Brian,

    Thank you for contacting us.

    The ComboBox handles the KeyDown event, so could you please send us a sample running project which we can test here locally on order to resolve the issue in a timely manner.

    Looking forward to your reply.

    Greetings,
    Konstantina
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top