DashboardViewer.SetMasterFilterAsync(String, AxisPointTuple) Method
Selects the specified elements in the specified master filter item.
Namespace: DevExpress.DashboardWin
Assembly: DevExpress.Dashboard.v20.1.Win.dll
NuGet Packages: DevExpress.Win.Dashboard, DevExpress.WindowsDesktop.Win.Dashboard
Declaration
Parameters
Name | Type | Description |
---|---|---|
dashboardItemName | String | A String that specifies the component name of the master filter item. |
tuple | AxisPointTuple | An AxisPointTuple object that identifies a master filter element. |
Returns
Type | Description |
---|---|
Task | The task object that is the asynchronous operation to complete. |
Example
This example demonstrates how to work in asynchronous mode to get filter values, set the master filter and perform an asynchronous task when the dashboard is loaded for the first time.
Note
Example on GitHub: How to Get FIlter Values and Set Master Filter Asynchronously
using DevExpress.DashboardCommon.ViewerData;
using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RandomFilterExample
{
public partial class ViewerForm1 : XtraForm {
public ViewerForm1() {
InitializeComponent();
dashboardViewer1.Initialized += OnDashboardViewerInitialized;
}
async void OnMouseClick(object sender, MouseEventArgs e) {
await RandomFilter();
}
async Task RandomFilter() {
string itemName = "choroplethMapDashboardItem1";
IList<AxisPointTuple> filters = await dashboardViewer1.GetAvailableFilterValuesAsync(itemName);
Random r = new Random();
int index = r.Next(0, filters.Count - 1);
await dashboardViewer1.SetMasterFilterAsync(itemName, filters[index]);
}
async void OnDashboardViewerInitialized(object sender, EventArgs e) {
await RandomFilter();
}
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SetMasterFilterAsync(String, AxisPointTuple) 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.