Skip to main content
All docs
V24.2

NonUniqueControlNameException Class

Occurs when the restored layout contains documents with duplicate ControlName properties.

Namespace: DevExpress.XtraBars.Docking2010.Views

Assembly: DevExpress.XtraBars.v24.2.dll

Declaration

[LogifyIgnoreException]
public class NonUniqueControlNameException :
    RestoreLayoutException

Remarks

Follow the steps below to fix this exception:

  1. Handle the BaseView.RestoreLayoutError event.
  2. Assign a new unique name to the NonUniqueControlNameException.ControlName property.
void tabbedView1_RestoreLayoutError(object sender, DevExpress.Utils.Serializing.RestoreLayoutErrorEventArgs e) {
    foreach (var exception in e.Exceptions) {
        if (exception is NonUniqueControlNameException nonUniqueException)
            nonUniqueException.ControlName = $"{nonUniqueException.ControlName}_1";
    }
    e.Throw = false;
}

Inheritance

Object
Exception
SystemException
InvalidOperationException
DevExpress.Utils.Serializing.RestoreLayoutException
NonUniqueControlNameException
See Also