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

Enter key, Autocomplete, keyboard nav and SelectionChanged

3 Answers 476 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Brian
Top achievements
Rank 1
Brian asked on 16 Apr 2010, 04:55 PM
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.

3 Answers, 1 is accepted

Sort by
0
Brian
Top achievements
Rank 1
answered on 16 Apr 2010, 05:25 PM
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.
0
Brian
Top achievements
Rank 1
answered on 16 Apr 2010, 05:49 PM

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();  
            }  
        }  
 


0
Konstantina
Telerik team
answered on 22 Apr 2010, 09:15 AM
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.
Tags
ComboBox
Asked by
Brian
Top achievements
Rank 1
Answers by
Brian
Top achievements
Rank 1
Konstantina
Telerik team
Share this question
or