Mulitiple RAD window controls in the same container

2 posts, 0 answers
  1. Dario
    Dario  avatar
    29 posts
    Member since:
    Mar 2009

    Posted 04 Jun 2009 Link to this post

    I developed simple UserControl (named "WindowsControl") 
    which contains single RadWindow (named "ListScreenWindow") control placed in the Grid (named "WindowPlaceHolder").
    Multiple instances of "WindowsControl" should be added to particular ItemsControl dinamically.
    The point is showing multiple RadWindow controls AT THE SAME TIME containing some buttons, gridview etc.
    Window is shown in the code-behind of user control like this: 
    private void UserControl_Loaded(object sender, RoutedEventArgs e) { ListScreenWindow.Show(); }

    First dynamically added control is shown correctly (window is shown), but second one throws exception in UserControl_Loaded:

    ArgumentException: The value does not fall into the specified range

    Maybe following piece of information might be helpfull for you:
    I use Prism2 (Composite Application Guidance library) and "WindowControl" is actually a view, and ItemsControl is region.

    Could you help us with this?
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 05 Jun 2009 Link to this post

    Hello Dario ,

    RadWindow cannot be placed in ItemsControl or ContentControl. It could be placed in a Panel but I don't recommend that - it is only allowed to let you customize your window in .xaml easily.

    Your event doesn't need to put your windows into the visual tree at all, so you can just loop through the items of your collection and create the Windows by yourself and open them. Just note that you need to do this after the application was loaded.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. DevCraft banner
Back to Top