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

Inherited RadWindow

7 Answers 318 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jeremy
Top achievements
Rank 1
Jeremy asked on 27 Oct 2008, 04:08 PM
I am having an issue showing multiple windows when having my User Control inherit from the RadWindow control (I am using the RC1 binaries).

I recieve an Exception of "Value does not fall within the expected range" when I try to open the second inherited RadWindow.  I was able to recreate this issue using the Examples solution provided with the binaries.  I added a new user control called InheritedWindow.  Following is the xaml and source for this object:
-- InheritedWindow.xaml:
<telerik:RadWindow x:Class="Telerik.Windows.Examples.Examples.Window.InheritedWindow" 
    xmlns
="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns
:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"     Width="400" Height="300">
<Grid x:Name="LayoutRoot">
    <TextBlock Text="SomeText"/>
</Grid>
</
telerik:RadWindow>

InheritedWindow.xaml.cs:
using Telerik.Windows.Controls;
namespace Telerik.Windows.Examples.Examples.Window {
    public partial class InheritedWindow : RadWindow {
        
public InheritedWindow() {
            InitializeComponent();
        }
    }
}


In order to create a new instance of the InheritedWindow I modified the Configurator.xaml.cs OnShowClicked event:
private void OnShowClicked(object sender, RoutedEventArgs e) {
    //createWindow().Show();
    InheritedWindow newWindow = new InheritedWindow();
    newWindow.Show();
}


When clicking the 'Open' button on the Configuration example the first window opens correctly.  If I then close this newly opened window the next 'Open' button click works correctly as well.  However, if I do not close this new window and issue another 'Open' button click I receive the exception.

Thank you for your help and information.
- Jeremy

7 Answers, 1 is accepted

Sort by
0
Hristo Borisov
Telerik team
answered on 30 Oct 2008, 11:51 AM
Hi Jeremy,

I cannot quite understand what you are trying to achieve by inheriting the RadWindow? Would you tell some more about your reasons to do so? Does RadWindow lack some functionality you need? As far as I can see you are calling InitializeComponent() in the constructor which is a sign that your class inherits from a user control, which RadWindow doesn't inherits. Moreover, the user control example that we have in the Examples solution is concerned with having a user control inside a RadWindow, not inheriting from it. Please tell us your goals and concerns so that we can better address our control's performance and functionality.

Regards,
Hristo Borisov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jeremy
Top achievements
Rank 1
answered on 30 Oct 2008, 03:58 PM

Hristo, thank you for your response.

The reason I would like to inherit the RadWindow is so that I can encapsulate the 'Form' functionality within each of my data capture components.  Certain data capture windows have expected behavior and I would like the component to control this behavior from within the component itself rather than have the calling/instantiating class handle the behavior (which is called in more than one class). 

The work around to this would be to have some type of service/factory class for each type of data component that I have and return the RadWindow instance back with all of the behavior set.  However this now means that I must keep the functionality and behavior for my data component in two separate classes (the data user control for functionality and the RadWindow service/factory class for the specific window behavior).

The reason I recreated the issue in the Example solution was to show a basic and quick example of the issue with inheriting the RadWindow.  Being able to inherit the RadWindow (much like an inherited form in WinForms) doesn't seem unreasonable for the sole purpose of encapsulating functionality and behavior within a component.

The main functionality I need is to be able to have a ‘Window’ class that I can put user controls onto and have the class handles it’s own responsibilities, which include some window behavior.

Thank you for the offer of extending the control, but I don’t think it’s in scope of your control, or feasible from your point of view (as a vendor) to take on the specific aspects of our business that your control would have to provide.  Just as RadWindow itself is inherited from ContentControl to extend it’s base purpose, clients of the RadWindow contol will need to extend upon your already significant functionality to encapsulate behavior specific to their business.

Thank you,
- Jeremy

0
Hristo Borisov
Telerik team
answered on 31 Oct 2008, 08:58 AM
Hello Jeremy,

Unfortunately, the current Silverlight framework introduces some bugs with its popup control that we are trying to surpass. I managed to fix and implement your case and use RadWindow as you use Window in WPF, but the issues with the Popup control in Silverlight break our current implementation of ComboBox and TreeView in case they are used inside a RadWindow. We will try to introduce this new feature for our service pack release, which is usually a month after the official one. I am really sorry that currently you cannot avoid this issue. As soon as we manage to fix the popup problems, we will implement template for adding a RadWindow from the new items menu. Thank you for your feedback.

Best wishes,
Hristo Borisov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mark Kempe
Top achievements
Rank 1
answered on 12 Dec 2008, 01:20 PM

Hello dear Hristo

 

 

We have the same critical problem without inherited  a Radwindows. We are using controls such  datepicker, comboboxes, grids within several radwindows in a dashboard (we are using these RADwindows as widgets). Basically our RadWindow contents are user controls.

 

Do you have a solutions already? Is there a Service pack available?

 

Thanks very much for your help

 

Kind Regards

Mauricio

0
Hristo
Telerik team
answered on 15 Dec 2008, 10:03 AM
Hi Mark,

We have fixed this problems. However there are two requirements to get the RadWindow to work. The first is to open RadWindow no earlier the Application.Current.RootVisual.Loaded event.
And the second is to have a Panel as a content of your RootVisual (this means that if Page is your main page then you should have a Panel as a content).

Please let me know if you need more information.


Best wishes,
Hristo
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Michael
Top achievements
Rank 1
answered on 21 Dec 2008, 08:45 PM

 

I am having the same Catastrophic Failure error with RadWindow. My main page has several canvas objects with borders, RadCombos, text boxes, etc. I assign a user control called FindCourse to the Window:

Dim
findWindow As New RadWindow

 

findWindow.Content =

New FindCourse

 

findWindow.Header =

"Find Course"

 

findWindow.ShowDialog()

I have a RadGridView in the FindCourse user control. If I click on a cell in the grid then I get the error. Or if I close the window after the RadGridView is loaded with data then I get the error.

Can you tell me more about the work around for this error? My main page needs a Stack Panel control?

Thanks

0
Hristo Borisov
Telerik team
answered on 23 Dec 2008, 03:21 PM
Hello Michael,

Can you give us a sample project on which we can reproduce the failure message? Sorry for the caused inconvenience, we look forward to hearing from you.

Kind regards,
Hristo Borisov
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Hristo Borisov
Telerik team
Jeremy
Top achievements
Rank 1
Mark Kempe
Top achievements
Rank 1
Hristo
Telerik team
Michael
Top achievements
Rank 1
Share this question
or