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

RadPaneGroup throws exception when HideAllPanes is used

3 Answers 58 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Socrates
Top achievements
Rank 1
Socrates asked on 23 Feb 2012, 04:08 PM
Hello,

I have a RadPaneGroup which contains a RadPane with a stack panel inside... In some cases I need to hide the whole group so I use:

oPaneGroup.HideAllPanes()

...which does hide the pane group, but also throws the exception:

Exception has been thrown by the target of an invocation.

Any idea why?

3 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 28 Feb 2012, 02:48 PM
Hi Socrates,

We were not able to reproduce the problem. I am sending you a simple project. I am using 2012.1 215 version of the controls.
Can you please take a look and tell if you are doing something different  than me?

Greetings,
Georgi
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Socrates
Top achievements
Rank 1
answered on 01 Mar 2012, 01:14 PM
Hi Georgi,

Your example works fine as well as some other panes I tried to hide, but here's the situation:

- I have PaneGroup (oPaneGroup1) which contains a Pane of type iCPane which is a class inheriting RadPane with a few more properties I need.
- I have another PaneGroup (oPaneGroup3) which contains a Pane of type RadPane, which is the one I'm trying to hide.

Calling oPaneGroup3.HideAllPanes() causes:
"Exception has been thrown by the target of an invocation."

After examining the InnerException I discovered the following:

{System.Reflection.TargetInvocationException: Exception
has been thrown by the target of an invocation. --->
System.InvalidCastException: Unable to cast object of type
'Telerik.Windows.Controls.RadPane' to type 'iCapture.iCPane'."
& vbCrLf & "   at iCapture.DockingExtensions.dock_PreviewClose
(Object sender, StateChangeEventArgs e)" & vbCrLf & "  
--- End of inner exception stack trace ---

I don't understand how the iCPane class is involved in this, since oPaneGroup3 only contains a normal RadPane, and I'm only calling HideAllPanes() on oPaneGroup3... Your thoughts on this?
0
Georgi
Telerik team
answered on 06 Mar 2012, 05:09 PM
Hi Socrates,

As you can see in the attached project we ware not able to reproduce the error. iCPane shouldn't be accessed when you try to hide  the Panes in oPaneGroup3.
Can you, please send us a simple project where the problem is reproducible?

All the best,
Georgi
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Docking
Asked by
Socrates
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Socrates
Top achievements
Rank 1
Share this question
or