Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

NonUniqueControlNameException Class

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

Namespace: DevExpress.XtraBars.Docking2010.Views

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#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