All docs
V18.2
19.1 (preview)
18.2
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

DashboardViewer.SetSelectedTabPage(String, Int32) Method

Selects the tab page specified by its index in the specified tab container.

Namespace: DevExpress.DashboardWin

Assembly: DevExpress.Dashboard.v18.2.Win.dll

Declaration

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

Parameters

Type Name Description
String tabContainerName

A String that is the TabContainerDashboardItem.ComponentName property value and identifies the tab container.

Int32 index

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

Examples

The following code implements tab navigation in the TabContainerDashboardItem control.

using DevExpress.DashboardCommon;
using System.Linq;
// ...

enum NextPrevValue {
    Next,
    Prev
}

void ShowNextPrevTab(NextPrevValue value) {
    Dashboard dashboard = dashboardViewer.Dashboard;
    TabContainerDashboardItem tabContainer = dashboard.Items.SingleOrDefault(i => i is TabContainerDashboardItem) as TabContainerDashboardItem;
        if(tabContainer != null) {
            int increment = value == NextPrevValue.Next ? 1 : -1;
            string tabContainerName = tabContainer.ComponentName;
            int selectedIndex = dashboardViewer.GetSelectedTabPageIndex(tabContainerName);
            int pageCount = tabContainer.TabPages.Count;
            dashboardViewer.SetSelectedTabPage(tabContainerName, (selectedIndex + pageCount + increment) % pageCount);
        }
} 
Note

The complete sample project How to navigate tabs using custom tab header buttons or set up a slide show is available in the DevExpress Examples repository.

See Also