RadComboBox inside RadWindow

6 posts, 0 answers
  1. NS
    NS avatar
    189 posts
    Member since:
    Jan 2007

    Posted 13 Oct 2008 Link to this post

    Hello,
    If I place a RadComboBox inside a RadWindow, I get an error while clicking on/opening the radcombobox.

    If I open this usercontrol directly, I don't get the error.

    The following javascript error is thrown:
    Sys.InvalidatOperationException: managedruntime error #4004 in 
    control 'Xaml1': System.Exception: Catastrophic failure (Exception from  
    HRRESULT: 0x8000FFFF (E_UNEXPEXPECTED))  
    at MS.INternalExcpImports.MethodEx(InPtr ptr, String name, CValue[] cvData-  
    at MS.Internal.XclImports.MethodPack(InPtr objectPtr, String methodName, Object[] rawData)  
    at MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element, UIElement visual)  
    at System.Windows.UIElement.TransformToVisual(UIElement visual)  
    at Telerik.Windows.Controls.PopupWrapper.GenerateClippingRegion()  
    at Telerik.Windows.Controls.PopupWrapper.ShowPopup()  
    at  
    Telerik.Windows.Controls.RadComboBox.OnIsDropDownOpenChanged  
    (Boolean oldValue, Boolean newValue)  
    at Telerik.Windows.Controls.RadComboBox<.cctor>b__2  
    (DependencyObject sender, DependencyPropertyChangedEventArgs e)  
    at  
    System.Windows.DependencyObject RaisePropertyChangeNotifications  
    (DependencyProperty dp, Object NewValue, Object oldValue)  
    at System.Windows.DependencyObject.SetValueInternal  
    (DependencyProperty dp, Object value, Boolean allowReadOnlySet,  
    Boolean isSetByStyle, Boolean isSetByBuiltInStyle)  
    at System.Windows.DependencyObject.SetValueInternal  
    (DependencyProperty dp, Object value)  
    at System.Windows.DependencyObject.SetValue  
    (DependencyProperty dp, Object value)  
    at System.Windows.DependencyObject.SetValue  
    (DependencyProperty dp, Object value)  
    at Telerik.Windows.Controls.RadComboBox.set_IsDropDownOpen  
    (Boolean value)  
    at Telerik.Windows.Controls.RadComboBox.DropDownButtonClick  
    (Object sender, RoutedEventArgs e)  
    at System.Windows.Controls.Primitives.ButtonBase.OnClick()  
    at System.Windows.Cotnrols.Primitives.ToggleButton.OnClick()  
    at  
    System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp  
    (MouseButtonEventArgs e)  
    at System.Windows.Controls.Control.OnMouseLeftButtonUp(Control ctrl, EventArgs e)  
    at MS.Internal.JoltHelper,FireEvent(InPtr unmanagedObj, InPtr unmanagedObjArgs, Int32 argsTypeIndes, String eventName) 

    I don't get the error while I replace the RadComboBox with a Microsoft ComboBox, but instead the page crashes :)

    Any help or suggestions ?
    Thanks,
    Nicolas
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 13 Oct 2008 Link to this post

    Hello Nicolas,

    I tested with the following code, but to no avail. I also tried with combo in user control in window, but still cannot reproduce it. We are aware of this problem, and we put a good deal of work resolving it, but we might be missing something. Could you please send me a simple application that demonstrates your case?

    The MS combo does not throw this exception because it contains code that hides it into a generic exception, but actually the result is the same :)

    <UserControl x:Class="SilverlightApplication11.Page2"

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    xmlns:inp="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"

    xmlns:nav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"

    Width="400" Height="300">

    <Grid x:Name="LayoutRoot" Background="White">

    <nav:RadWindow x:Name="window" Header="Combo bug" Loaded="window_Loaded">

    <inp:RadComboBox>

    <inp:RadComboBoxItem Content="AAA"/>

    <inp:RadComboBoxItem Content="BBB"/>

    <inp:RadComboBoxItem Content="CCC"/>

    </inp:RadComboBox>

    </nav:RadWindow>

    </Grid>

    </UserControl>



    using System.Windows;

    using System.Windows.Controls;

    using Telerik.Windows.Controls;



    namespace SilverlightApplication11

    {

    public partial class Page2 : UserControl

    {

    public Page2()

    {

    InitializeComponent();

    RadWindow w = new RadWindow();

    w.Header = "COMBO2";

    RadComboBox cb = new RadComboBox();

    cb.ItemsSource = new object[] { 111, 222, 333 };

    w.Content = cb;

    w.Show();

    }



    private void window_Loaded(object sender, RoutedEventArgs e)

    {

    window.Show();

    }

    }

    }



    Regards,
    Valeri Hristov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. NS
    NS avatar
    189 posts
    Member since:
    Jan 2007

    Posted 14 Oct 2008 Link to this post

    Hi Valeri,
    I opened a support ticket with ID: 167413.
    There is a demo project attached to this Support Ticket.

    Thanks for your help,
    Nicolas
  4. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 14 Oct 2008 Link to this post

    Hello Nicolas,

    Thank you for the application. I managed to reproduce the problem, but I am having difficulties simplifying the application in order to find the real reason for the exception. I will continue to dig, but it will take some time.

    Generally, the problem is caused by a bug in Silverlight, that was left unfixed by MSFT, which is related to controls that are placed in Popup. In certain situations if you call TransformToVisual on a control, that is inside Popup, the Framework throws the exception you are getting. We tried to isolate as many scenarios as we could, but it seems that we missed at least the one that your application is using.

    I am sorry for the inconvenience, hopefully in a couple of days I will be able to provide you with a solution or a fix.

    Best wishes,
    Valeri Hristov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. NS
    NS avatar
    189 posts
    Member since:
    Jan 2007

    Posted 16 Oct 2008 Link to this post

    Hi Valeri,
    Have you any updates on my problem ?
    Or some tips on how to avoid the situation that causes this problem ? (is it the way I call RadWindow, or is the way that the layout is set in the RadWindow)

    Thanks,
    Nicolas
  6. NS
    NS avatar
    189 posts
    Member since:
    Jan 2007

    Posted 17 Oct 2008 Link to this post

    I actually just found the solution.
    Browsing the silverlight.net forum learned that other users also have some problems using the Silverlight Popup control.

    You have to add the window (or popup) to a visualtree on the usercontrol.

    If I place in the _loaded grid.children.add(mywindow) comboboxes in the window work :)
Back to Top