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

DashboardViewer.GetSelectedTabPageIndex(String) Method

Gets the index of the selected page in the specified tab container.

Namespace: DevExpress.DashboardWin

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


public int GetSelectedTabPageIndex(
    string tabContainerName
Public Function GetSelectedTabPageIndex(
    tabContainerName As String
) As Integer


Name Type Description
tabContainerName String

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


Type Description

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


The following code implements tab navigation in the TabContainerDashboardItem control.

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

enum NextPrevValue {

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);

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