Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ComboBox > RadComboBox drop-down list loses focus when hosted in Silverlight 5 native windows

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

Feed from this thread
  • I avatar

    Posted on Feb 3, 2012 (permalink)

    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

    Reply

  • Answer Valeri Hristov Valeri Hristov admin's avatar

    Posted on Feb 3, 2012 (permalink)

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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ComboBox > RadComboBox drop-down list loses focus when hosted in Silverlight 5 native windows
Related resources for "RadComboBox drop-down list loses focus when hosted in Silverlight 5 native windows"

Silverlight ComboBox Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]