Menu

Invalid Content: ActiveContent must be one...

dbonura
2007-05-22
2013-04-24
  • dbonura

    dbonura - 2007-05-22

    I try to disconnect DockContent from DockPanel :

    dockContentSample.DockPanel = null;

    But i get this exception:

    Invalid Content: ActiveContent must be one of the visible
    contents, or null if there is no visible content.

    I'm looking for a way to load a new layout with new and one
    old dockContent without dispose and reacreate the old one.

    Thanks
    Diego

     
    • Weifen Luo

      Weifen Luo - 2007-05-23

      This is a bug and has been fixed in the SVN.

       
      • Matt Barber

        Matt Barber - 2008-06-02

        Just thought I'd pass on the following info as well.  The following code will throw the ActiveContent exception mentioned above. 

        ClientBrowserFrm browserFrm = new ClientBrowserFrm(); // ClientBrowserFrm is derived from DockContent
        browserFrm.MdiParent = this; // commenting out this line will fix the error
        browserFrm.Show(dockPanel);

        I just ran into this as I used to run the 1.0 version of DockPanel, but as of 2.2 the ActiveContent exception will be thrown if you set the DockContent's MdiParent property

         
    • Jeep

      Jeep - 2007-05-23

      It's only partly fixed!

      It's still possibly to get this exception when disconnecting DockContent from DockPanel even in DockSample.

      It happens when there is no active window in DockPanel (situation can be reached by closing the active window and next window that becomes active). The exception is thrown when the already hided "next window that becomes active" DockPanel property is set to null.

      DockSample example:

      ->Layout By Code
      ->Close all document windows
      ->Click Properties windows so that it gets the focus
      ->Close DockSample (saving layout)
      ->Start DockSample again
      ->Close(Hide) Properties window
      ->Close(Hide) the active window (Solution Explorer)
      ->Layout By XML
         ->Unhandled exception (DockPane, line 166)

       
      • Weifen Luo

        Weifen Luo - 2007-05-24

        Fixed again.

         
    • dbonura

      dbonura - 2007-05-24

      Thanks!

      I would like to know if is planned a release of the binary with this fix..and when.
      Otherwise i will donwload the svn version.

      Diego

       
    • Pierre Mazoyer

      Pierre Mazoyer - 2007-05-28

      I found another way to raise this exception with latest SVN sources (2007-05-28).

      With DockSample example:

      1- Do a "Layout by code".
      2- Close all documents and panels but "Properties" and "Solution Explorer" (which are grouped on right side).
      3- Click on "Properties" panel's "Auto Hide" button.

      => System.InvalidOperationException: Invalid Content: ActiveContent must be one of the visible contents, or null if there is no visible content.
      at WeifenLuo.WinFormsUI.Docking.DockPane.set_ActiveContent(IDockContent value)
      in DockPane.cs:line 162

       
      • dbonura

        dbonura - 2007-05-29

        The same here!

         
      • Weifen Luo

        Weifen Luo - 2007-05-30

        Fixed.

         

Log in to post a comment.