BaseDocument.ControlName Property
Gets or sets the name of a control that will be passed to the current Document as content.
Namespace: DevExpress.XtraBars.Docking2010.Views
Assembly: DevExpress.XtraBars.v19.1.dll
Declaration
Property Value
Type | Default | Description |
---|---|---|
String | *null* | A String value specifying the name of a control that will be passed to the current Document as content. |
Remarks
Your may want to set your own User Controls as the Document content. The image below illustrates an application example with 3 UserControls included in the solution:
Now we can run the Document Manager Designer, switch to its ‘Documents’ tab and click the ‘Populate’ button. A Document for each of the UserControls is generated automatically:
Notice that each Document has its ControlName and BaseDocument.ControlTypeName properties specified. These properties refer to a corresponding UserControl by its name and type respectively. In spite of this relation, Documents have no content yet. Call the BaseView.AddDocument overload method and pass a new instance of a UserControl as the control parameter before the form is shown:
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
documentManager1.View.AddDocument(new UserControls.UserControl1());
documentManager1.View.AddDocument(new UserControls.UserControl2());
documentManager1.View.AddDocument(new UserControls.UserControl3());
}
}
This won’t create any new Documents. Instead, required UserControls will be passed to corresponding Documents as their content.
You can also manually create a Document that refers to a UserControl by name via the BaseView.AddDocument overload method that takes 2 string parameters.
Related GitHub Examples
The following code snippets (auto-collected from DevExpress Examples) contain references to the ControlName property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.