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

RadComboBox drop-down list loses focus when hosted in Silverlight 5 native windows

1 Answer 89 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
I
Top achievements
Rank 1
I asked on 03 Feb 2012, 12:58 PM

The current implementation of Telerik’s RadComboBox has a focus issue on the drop-down list when hosted in a Silverlight 5 native/secondary window (in OOB applications). When you try to move the mouse down to select the drop-down list items the popup containing the items disappears (it works fine with keyboard).

Silverlight 5 provides a new overload of the FocusManager.GetFocusedElement method that takes the required window as a parameter: http://msdn.microsoft.com/en-us/library/ms604088(v=vs.95).aspx

This must be called to find the focused element in the correct window, otherwise by default it returns the focused element of the main window.

Fix to Telerik’s RadComboBox control:

Solution: Input_SL
Project: Input_SL
File: ComboBox/RadComboBox.cs
Method: IsFocusWithin

private bool IsFocusWithin
{
          get
       {    // Start fix
            var element = Window.GetWindow(this) as DependencyObject;
            FrameworkElement focusedElement =
               element == null
               ? this.GetFocusedElement() as FrameworkElement
               : FocusManager.GetFocusedElement(element) as FrameworkElement;                                    
            // End fix
            if (focusedElement != null)
            {
              return
                   focusedElement == this ||
                   this.IsAncestorOf(focusedElement) ||
                  (this.dropDownPopup != null && 
                   this.dropDownPopup.IsOpen && 
                   this.dropDownPopup.Child != null && 
                   (this.dropDownPopup.Child as FrameworkElement).IsAncestorOf(focusedElement)
                  );
            }
            return false;
       }
 

Note: this is not an issue when using Microsoft's Silverlight 5 ComboBox implementation

1 Answer, 1 is accepted

Sort by
0
Accepted
Valeri Hristov
Telerik team
answered on 03 Feb 2012, 02:55 PM
Hello,

Thank you for your feedback. This is a known problem that will be resolved with the Q1 2012 release, due in a couple of weeks. I am afraid that the fix will not be available in the upcoming final internal build for Q3 2011.

All the best,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
ComboBox
Asked by
I
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or