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

OpenDropDownOnFocus="True" Leaves DropDown Open when fast tabbing.

5 Answers 154 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 13 Jan 2016, 07:35 PM

So there's multiple RadComboBox's nested in a ScrollViewer each with OpenDropDownOnFocus=True

 The problem is if you hold down tab, then even AFTER each control loses focus, many of them still keep their dropdown part open resulting in a lot of stacked up dropdowns open which is obviously undesired. Is there some lost focus timer or something I'm missing to keep this from happening and to actually ensure every drop down closes as soon as the control loses focus?

 

Thanks!

5 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 14 Jan 2016, 06:09 PM

I kind of expected no re-response. So if anyone else runs into this. All I did was attach to the LostFocus and property change IsDropDownOpen to False to politely remind the control again to close it's damn drop down even if the user is speeding through through focusing.

 Cheers!

0
Chris
Top achievements
Rank 1
answered on 14 Jan 2016, 09:56 PM
Correction, I didn't notice immediately but my previous answer is a no go. Since focus is passed to the dropdown if a user tries to mouse to their selection they cant hit because the DropDown gets closed using my previous statement, so disregard. Still looking for a solution.
0
Georgi
Telerik team
answered on 18 Jan 2016, 12:38 PM
Hello Chris,

You can prevent the DropDown to stay open by closing it using Dispatcher:

protected override void OnLostFocus(RoutedEventArgs e)
       {
           if (!this.IsKeyboardFocusWithin)
           {
               Dispatcher.BeginInvoke(new Action(() =>
               {
                   if (this.IsDropDownOpen)
                   {
                       this.IsDropDownOpen = false;
                   }
               }));
           }
           base.OnLostFocus(e);
       }

More on the described approach you can find in the attached project. So it would be great if you could give it a try and let us know if this works for you.

Looking forward to your reply.

Regards,
Georgi
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Chris
Top achievements
Rank 1
answered on 18 Jan 2016, 09:09 PM
Thanks for the reply! What I ended up doing was just using the VisualStateManager Unfocused VisualState to throw IsOpen to False. Seems to work fine and just applied it to both default templates so it's global. Thank you again!
0
Georgi
Telerik team
answered on 19 Jan 2016, 08:13 AM
Hello Chris,

I am glad that you were able to find the most suitable solution to your scenario.

Also If you have any other questions or concerns, please don't hesitate to write us.

Regards,
Georgi
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
ComboBox
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Georgi
Telerik team
Share this question
or