Skip to main content

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

BaseView.AddDocument(String, String) Method

Adds an empty Document with specified BaseDocument.Caption and BaseDocument.ControlName properties to the current View.

Namespace: DevExpress.XtraBars.Docking2010.Views

Assembly: DevExpress.XtraBars.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public BaseDocument AddDocument(
    string caption,
    string controlName
)

#Parameters

Name Type Description
caption String

A String value that is the newly created Document’s BaseDocument.Caption.

controlName String

A String value that is the newly created Document’s BaseDocument.ControlName property value.

#Returns

Type Description
BaseDocument

A BaseDocument object created.

#Remarks

The AddDocument method adds a new Document to the View. This Document has no content yet, but it refers to a Control (for instance, a UserControl) via the BaseDocument.ControlName property. On application start-up, before the form is shown, call the BaseView.AddDocument overload method that takes a control as a parameter and pass a new instance of this UserControl to this method. This won’t create any new documents. Instead, a Document created via the AddDocument method will receive a UserControl specified via the BaseDocument.ControlName property as a content.

//Creates an empty Document 'Doc 1' that refers to the UserControl1
documentManager1.View.AddDocument("Doc 1", "UserControl1");
//Sets the UserControl1 as a content for the 'Doc 1'
documentManager1.View.AddDocument(new UserControls.UserControl1());
See Also