Back to Devexpress

TabContainerActiveChildNotSetException Class

windowsforms-devexpress-dot-xtrabars-dot-docking-f9b542db.md

latest2.3 KB
Original Source

TabContainerActiveChildNotSetException Class

Occurs when the DockPanel.ActiveChild property of the restored tab container is not specified.

Namespace : DevExpress.XtraBars.Docking

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public class TabContainerActiveChildNotSetException :
    RestoreLayoutException
vb
Public Class TabContainerActiveChildNotSetException
    Inherits RestoreLayoutException

Remarks

Follow the steps below to fix this exception:

  1. Handle the DockManager.RestoreLayoutError event.
  2. Assign a panel from the container to the ActiveChild property.
csharp
void dockManager1_RestoreLayoutError(object sender, DevExpress.Utils.Serializing.RestoreLayoutErrorEventArgs e) {
    foreach (var exception in e.Exceptions) {
        if (exception is TabContainerActiveChildNotSetException activeChildException)
            activeChildException.Panel.ActiveChild = activeChildException.Panels[1];
    }
    e.Throw = false;
}

Inheritance

Object Exception SystemException InvalidOperationException DevExpress.Utils.Serializing.RestoreLayoutException TabContainerActiveChildNotSetException

See Also

TabContainerActiveChildNotSetException Members

DevExpress.XtraBars.Docking Namespace