RadPaneGroup throws exception when HideAllPanes is used

4 posts, 0 answers
  1. Socrates
    Socrates avatar
    2 posts
    Member since:
    Feb 2012

    Posted 23 Feb 2012 Link to this post

    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?
  2. Georgi
    Admin
    Georgi avatar
    349 posts

    Posted 28 Feb 2012 Link to this post

    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 >>
  3. DevCraft banner
  4. Socrates
    Socrates avatar
    2 posts
    Member since:
    Feb 2012

    Posted 01 Mar 2012 Link to this post

    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?
  5. Georgi
    Admin
    Georgi avatar
    349 posts

    Posted 06 Mar 2012 Link to this post

    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 >>
Back to Top