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

RibbonControl.SelectPage(RibbonPage) Method

Activates the specified ribbon page. This method can be used to activate pages in merged ribbons.

Namespace: DevExpress.XtraBars.Ribbon

Assembly: DevExpress.XtraBars.v19.1.dll

Declaration

public void SelectPage(
    RibbonPage page
)

Parameters

Name Type Description
page RibbonPage

A RibbonPage object specifying the page to select.

Remarks

When ribbons are not merged, you can activate a page by using the SelectPage method or the RibbonControl.SelectedPage property. These means are equivalent.


//These two lines or code have the same effect in a not merged ribbon.
ribbon.SelectPage(ribbonPage);
ribbon.SelectedPage = ribbonPage;

When ribbons are merged, to activate a page in a ribbon, use the SelectPage method.


//When ribbons are merged, use this code to activate a page.
childRibbon.SelectPage(childRibbonPage);
//This code allows you also to select a ribbon page.
parentRibbon.SelectPage(childRibbonPage);
parentRibbon.SelectPage(parentRibbonPage);

When you merge a child ribbon with a parent ribbon, copies of child ribbon pages are created and added to the parent ribbon. The RibbonControl.Pages and RibbonPageCategory.Pages collections contain parent pages, while the RibbonControl.MergedPages and RibbonPageCategory.MergedPages collections contain copies of child pages. Another way to activate a child ribbon page is to locate its copy in the RibbonControl.MergedPages or RibbonPageCategory.MergedPages collection, and then pass it to the SelectPage method or assign it to the RibbonControl.SelectedPage property.


//Selects the Templates page of a child ribbon merged with a parent ribbon.
parentRibbon.SelectPage(parentRibbon.MergedPages["Templates"]);
parentRibbon.SelectedPage = parentRibbon.MergedPages["Templates"];

When ribbons are merged, you cannot use the RibbonControl.SelectedPage property to activate a page in a child ribbon.


//When ribbons are merged, this code has no effect.
childRibbon.SelectedPaged = childRibbonPage;
See Also