The requested page is not available for the requested platform. You are viewing the content for Default platform.

DashboardControl.SetSelectedTabPage(String, Int32) Method

Selects the page specified by its parent container name and by the index in the page collection.

Namespace: DevExpress.DashboardWpf

Assembly: DevExpress.Dashboard.v19.1.Wpf.dll


public void SetSelectedTabPage(
    string tabContainerName,
    int index
Public Sub SetSelectedTabPage(
    tabContainerName As String,
    index As Integer


Name Type Description
tabContainerName String

A String that is the TabContainerDashboardItem component name.

index Int32

An integer that is the page index in the TabPages collection.


The following code selects the last page in a tab container and displays its component name and index in the TabContainerDashboardItem.TabPages collection.

TabContainerDashboardItem tabContainer = dashboardControl.Dashboard.Items.
    FirstOrDefault(item => item is TabContainerDashboardItem) as TabContainerDashboardItem;
if (tabContainer != null)
    dashboardControl.SetSelectedTabPage(tabContainer.ComponentName, tabContainer.TabPages.Count-1);
string pageComponentName = dashboardControl.GetSelectedTabPage(tabContainer.ComponentName);
int pageIndex = dashboardControl.GetSelectedTabPageIndex(tabContainer.ComponentName);
MessageBox.Show(string.Format("Page {0} with index {1} is selected.", pageComponentName, pageIndex));

The complete sample project How to Create and Modify Dashboard Items and Tab Pages in WPF Viewer is available in the DevExpress Examples repository.

See Also