Back to Devexpress

BaseDocument.ControlTypeName Property

windowsforms-devexpress-dot-xtrabars-dot-docking2010-dot-views-dot-basedocument-97a47f4d.md

latest3.6 KB
Original Source

BaseDocument.ControlTypeName Property

Gets or sets the type of a control that will be passed to the current Document as content.

Namespace : DevExpress.XtraBars.Docking2010.Views

Assembly : DevExpress.XtraBars.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public string ControlTypeName { get; set; }
vb
Public Property ControlTypeName As String

Property Value

TypeDescription
String

A String value specifying the type of a control that will be passed to the current Document as content.

|

Remarks

Note

Use the BaseDocument.ControlType property instead to specify the control type.

You may want to set your own User Controls as the Document content. The image below illustrates an application example with 3 UserControls included to 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 BaseDocument.ControlName and 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:

csharp
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());
    }
}
vb
Public Partial Class Form1
    Inherits Form
    Public Sub New()
        InitializeComponent()
        documentManager1.View.AddDocument(New UserControls.UserControl1())
        documentManager1.View.AddDocument(New UserControls.UserControl2())
        documentManager1.View.AddDocument(New UserControls.UserControl3())
    End Sub
End Class

This method does not create new Documents - it passes specified UserControls to corresponding Documents as their content instead.

See Also

ControlName

AddDocument

BaseDocument Class

BaseDocument Members

DevExpress.XtraBars.Docking2010.Views Namespace