Skip to main content

DashboardViewer.SetSelectedTabPage(String, Int32) Method

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

Namespace: DevExpress.DashboardWin

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

NuGet Package: DevExpress.Win.Dashboard

Declaration

public void SetSelectedTabPage(
    string tabContainerName,
    int index
)

Parameters

Name Type Description
tabContainerName String

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

index Int32

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

Example

The following code implements tab navigation in the TabContainerDashboardItem control.

View Example: How to navigate tabs using custom tab header buttons or set up a slide show

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

The following code snippets (auto-collected from DevExpress Examples) contain references to the SetSelectedTabPage(String, Int32) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also