DashboardViewer.GetSelectedTabPage(String) Method
In This Article
Gets the selected page in the specified tab container.
Namespace: DevExpress.DashboardWin
Assembly: DevExpress.Dashboard.v24.2.Win.dll
NuGet Package: DevExpress.Win.Dashboard
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
tab |
String | A String that is the Tab |
#Returns
Type | Description |
---|---|
String | A String that is the Dashboard |
#Example
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);
}
}
#Implements
See Also