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

2 posts, 1 answers
  1. I
    I avatar
    2 posts
    Member since:
    Mar 2011

    Posted 03 Feb 2012 Link to this post

    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

  2. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2244 posts
    Member since:
    Sep 2012

    Posted 03 Feb 2012 Link to this post

    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 >>

Back to Top