Skip to main content

ITabbedViewController.MoveToMainDocumentGroup(Document) Method

Docks the specific Document to the main DocumentGroup.

Namespace: DevExpress.XtraBars.Docking2010.Views.Tabbed

Assembly: DevExpress.XtraBars.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

bool MoveToMainDocumentGroup(
    Document document
)

Parameters

Name Type Description
document Document

A Document to be docked to the Document Group.

Returns

Type Description
Boolean

true if docking was successfully performed; otherwise, false.

Remarks

The MoveToMainDocumentGroup method is in effect only when the target floating Document is hosted within a Documents Host (see the BaseView.FloatingDocumentContainer property for the details). The word ‘main’ in the method’s name signifies the last selected DocumentGroup within the parent application form. So if the parent form contains only one Document Group, the target Document will be docked to it. If two or more Document Groups exist, the Document will be docked into the Group selected last.

The code below illustrates how to dock a Document, currently selected within a Documents Host, back to the main application form by by a BarButtonItem click. To get the currently selected Document, handle the DocumentManager.DocumentActivate event.

DevExpress.XtraBars.Docking2010.Views.Tabbed.Document currentDoc;

void documentManager1_DocumentActivate(object sender, DevExpress.XtraBars.Docking2010.Views.DocumentEventArgs e) {
    currentDoc = e.Document as Document;
}

private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) {
    tabbedView1.Controller.MoveToMainDocumentGroup(currentDoc);
}

At runtime, end-users can move Documents from a floating container to the main group by clicking the corresponding item in the Documents’ context menu (see the figure below).

DocumentManager - MoveToMainGroup

See Also