Skip to main content
A newer version of this page is available. .

DocumentManager Class

The component that allows you to implement tabbed, native MDI, Windows 10-inspired or Widget application UIs.

Namespace: DevExpress.XtraBars.Docking2010

Assembly: DevExpress.XtraBars.v17.2.dll

Declaration

[ToolboxTabName("DX.17.2: Navigation & Layout")]
[SerializationOrder(Order = 2)]
[ToolboxBitmap(typeof(ToolboxIconsRootNS), "Docking2010.DocumentManager")]
public class DocumentManager :
    BaseComponent,
    IUIElement,
    IMdiClientSubclasserOwner,
    IViewRegistrator,
    IMdiClientListener,
    IDocumentsHostOwner,
    IClientControlListener,
    IToolTipControlClient,
    IProcessRunningListener,
    IServiceProvider,
    IBarMouseActivateClient,
    IBarAndDockingControllerClient,
    ILogicalOwner,
    ISnapSupport

Remarks

The DocumentManager component is a powerful tool capable of emulating most popular classic and modern application UIs, including:

Each of these UI types is implemented via the related View object (TabbedView, NativeMdiView, WindowsUIView or WidgetView), derived from the BaseView class. All of these Views share a common concept - managing Document objects. A Document is a metaphor, a non-visual object that can wrap any form, user-control, standard or third-party control (see the Documents topic to learn how to create and manage Documents). Each View operates its own Document type, derived from the base BaseDocument class, and stores its Documents in the BaseView.Documents collection. To assign a required View to the DocumentManager, use the DocumentManager.View property.

The DocumentManager component can be used with the Dock Manager within the single application form. In this case, both of these DevExpress components gain several unique features, listed in the Interaction with Dock Panels topic. If you want these features for your application, but do not need multiple Documents within your View, switch the DocumentManager to the Non-Document Mode.

Note

If you need a simple and plain tabbed UI with minimum additional features, we recommend using the XtraTabbedMdiManager component rather then the DocumentManager with Tabbed View applied.

Native MDI View Example

This example shows how to enable a native MDI for a DocumentManager where MDI child windows are presented as regular windows within a container.

NativeMdi_ex

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraBars.Docking2010;
using DevExpress.XtraBars.Docking2010.Views.NativeMdi;
using DevExpress.XtraEditors;

namespace DocumentManager_NativeMDI {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }
        int childCount = 0;
        private void Form1_Load(object sender, EventArgs e) {
            CreateDocumentManager();
            for(int i = 0; i < 3; i++) {
                AddChild();
            }
        }
        void CreateDocumentManager() {
            DocumentManager dm = new DocumentManager();
            dm.MdiParent = this;
            dm.View = new NativeMdiView();
        }
        void AddChild() {
            Form childForm = null;
            childForm = new Form();
            childForm.Text = "Child Form " + (++childCount);

            SimpleButton btn = new SimpleButton();
            btn.Text = "Button " + childCount;
            btn.Parent = childForm;

            childForm.MdiParent = this;
            childForm.Show();
        }
    }
}

Tabbed View Example

This example shows how to enable a tabbed UI for a DocumentManager where MDI child windows are presented as tab pages.

TabbedUI_ex

using System;
using System.Windows.Forms;
using DevExpress.XtraBars.Docking2010;
using DevExpress.XtraBars.Docking2010.Views.Tabbed;
using DevExpress.XtraEditors;

namespace DocumentManager_TabbedUI {
    public partial class Form1 : Form {
        public Form1() {
            InitializeComponent();
        }
        void Form1_Load(object sender, EventArgs e) {
            AddDocumentManager();
            for(int i = 0; i < 3; i++) {
                AddChildForm();
            }
        }
        void AddDocumentManager() {
            DocumentManager manager = new DocumentManager();
            manager.MdiParent = this;
            manager.View = new TabbedView();
        }
        int count;
        void AddChildForm() {
            Form childForm = new Form();
            childForm.Text = "Child Form " + (++count).ToString();

            SimpleButton btn = new SimpleButton();
            btn.Text = "Button " + count.ToString();
            btn.Parent = childForm;

            childForm.MdiParent = this;
            childForm.Show();
        }
    }
}

Widget View Example

This example demonstrates how to create and customize the WidgetView at runtime. In this example, the WidgetView contains two StackGroups, which host three Documents. Each Document displays different content in its normal and maximized states. StackGroups have relative lengths (their Length.UnitType properties are set to Star), which allows them to dynamically resize whenever the parent form resizes.

Note

1. When creating the Widget View-based application at runtime, do not specify the DocumentManager.MdiParent property manually. Otherwise, widgets will not be displayed.

2. Be sure to set the DocumentManager.ContainerControl property after the View is created and assigned to the DocumentManager.View property.

// Developer Express Code Central Example:
// How To: Create WidgetView at runtime
// 
// This example demonstrates how to create and customize WidgetView with 2
// StackGroups at runtime.
// 
// You can find sample updates and versions for different programming languages here:
// http://www.devexpress.com/example=E5003

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WidgetViewExample {
    public partial class ucPreview : UserControl {
        public ucPreview() {
            InitializeComponent();
        }
    }
}

Windows UI View Getting Started

Getting Started

The following code snippets (auto-collected from DevExpress Examples) contain references to the DocumentManager class.

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.

Inheritance

Object
MarshalByRefObject
Component
DevExpress.XtraBars.Docking2010.Base.BaseComponent
See Also