This question is locked. New answers and comments are not allowed.
Hi,
i have a problem with either the RadGridView or the RadWindow. The thing is that it causes my application to quit but i don't know if this could be the right thread.
So, i am using a RadWindow to load a UserControl that has a RadGridView.
On the _Loaded event i am communicating with a WCF Service and i bind the data on the callback of that function. Everything works ok till now. The problem occurs when i try to close the RadWindow, where i get an Exception which causes my application to quit.
I made a sample application on which i am doing the same thing but with random data on a custom class i made, just to be certain that this is something that hasn't got to do with the sevice in a way. I got the same error though.
An unhandled exception ('Sys.InvalidOperationException:
ManagedRuntimeError error #4004 in control 'Xaml1':
System.ArgumentException : Value does not fall within the expected range.
at MS.Internal.XcpImports.MethodEx(InPtr ptr, String name, CValue[] cvData)
The class i am binding is a simple one with 4 string properties.
With a simple DataGrid everything works fine. I am not doing anything special to the Grid. I am just binding the data and then closing the window.
(I can open a support ticket and send you the application if you want.)
Many thanks,
Antonis
7 Answers, 1 is accepted
0
Hi Antonis,
Can you provide more details on how you bind the RadGridView, so that I can reproduce the problem on my end? A sample project would really be great -- please open up a separate support ticket to attach that. I will update this thread with our findings, so that other people with similar problems can resolve them quickly.
Thanks!
Kind regards,
Hristo Deshev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Can you provide more details on how you bind the RadGridView, so that I can reproduce the problem on my end? A sample project would really be great -- please open up a separate support ticket to attach that. I will update this thread with our findings, so that other people with similar problems can resolve them quickly.
Thanks!
Kind regards,
Hristo Deshev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Antonis
Top achievements
Rank 2
answered on 22 Dec 2008, 03:34 PM
Ok, done!
0
Jeremy
Top achievements
Rank 1
answered on 23 Dec 2008, 04:08 PM
I am running into the same issue after I downloaded and started referencing the new futures build that was just released (RadControls for Silverlight 2008 3 1217 Futures).
I am very intersested in the resolution to this issue.
Thank you
- Jeremy
I am very intersested in the resolution to this issue.
Thank you
- Jeremy
0
Antonis
Top achievements
Rank 2
answered on 23 Dec 2008, 04:28 PM
I found a workaround on this issue but i don't know if this is going to help you much on your project.
I placed the RadGridView of my UserControl into a RadExpander (i did it because i had some other controls on the UserControl so i wanted to give the functionality to the user to select which ones will be expanded) and so my project stopped having these Exceptions when i was closing the RadWindow.
You can use it till they publish the next version of RadGridView.
I placed the RadGridView of my UserControl into a RadExpander (i did it because i had some other controls on the UserControl so i wanted to give the functionality to the user to select which ones will be expanded) and so my project stopped having these Exceptions when i was closing the RadWindow.
You can use it till they publish the next version of RadGridView.
0
Jeremy
Top achievements
Rank 1
answered on 23 Dec 2008, 07:20 PM
Antonis,
Thank you for the suggested workaround. An exander doesn't really fit for this particular GridView part of my project, however I did try putting the GridView inside the expander just to see if it would work for me. It did seem to work if the RadExpander was in the collapsed state, however if the RadExpander was in the expanded state I would get the same exception.
Again, thank you for the suggestion. If you run across any others that might work please post.
Thank you,
- Jeremy
Thank you for the suggested workaround. An exander doesn't really fit for this particular GridView part of my project, however I did try putting the GridView inside the expander just to see if it would work for me. It did seem to work if the RadExpander was in the collapsed state, however if the RadExpander was in the expanded state I would get the same exception.
Again, thank you for the suggestion. If you run across any others that might work please post.
Thank you,
- Jeremy
0
Accepted
Hi Antonis, Jeremy,
I am posting my findings and the workaround for the problem below:
I am very close to believing we have hit a Silverlight bug with regards to handling focus -- closing the RadWindow triggers a GotFocus event for a cell in the RadGridView control. The RadGridView control is no longer in the visual tree and that caused the exception. I have fixed the problem in our development version of the code.
You can use a simple workaround -- you need to focus a control different than RadGridView a bit before the RadWindow closes (in the PreviewClosed event handler):
Another option is to set the RadWindow content Visibility property to Collapsed, but I think the focusing in the PreviewClosed event is simpler.
Sincerely yours,
Hristo Deshev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
I am posting my findings and the workaround for the problem below:
I am very close to believing we have hit a Silverlight bug with regards to handling focus -- closing the RadWindow triggers a GotFocus event for a cell in the RadGridView control. The RadGridView control is no longer in the visual tree and that caused the exception. I have fixed the problem in our development version of the code.
You can use a simple workaround -- you need to focus a control different than RadGridView a bit before the RadWindow closes (in the PreviewClosed event handler):
| private void l_Click(object sender, RoutedEventArgs e) |
| { |
| RadWindow window = new RadWindow() |
| { |
| Height = 400, |
| Width = 600, |
| PinMode = PinMode.Pin, |
| CloseMode = CloseMode.Close |
| }; |
| window.Margin = new Thickness(0); |
| window.Content = new Simple(); |
| window.Show(); |
| window.PreviewClosed += new EventHandler<WindowPreviewClosedEventArgs>(window_PreviewClosed); |
| } |
| void window_PreviewClosed(object sender, WindowPreviewClosedEventArgs e) |
| { |
| this.Focus(); |
| } |
Another option is to set the RadWindow content Visibility property to Collapsed, but I think the focusing in the PreviewClosed event is simpler.
Sincerely yours,
Hristo Deshev
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Antonis
Top achievements
Rank 2
answered on 30 Dec 2008, 03:11 PM
Ok, many thanks!