DashboardDesigner.SetRange(String, RangeFilterSelection) Method
Selects the required range in the specified Range Filter dashboard item.
Namespace: DevExpress.DashboardWin
Assembly: DevExpress.Dashboard.v18.2.Win.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
dashboardItemName | String | A String that specifies the component name of the Range Filter dashboard item. |
range | RangeFilterSelection | A RangeFilterSelection object that specifies a range in the Range Filter dashboard item. |
Example
The following example demonstrates how to apply filtering for dashboard items that act as a master filter.
In this example, the DashboardViewer.SetMasterFilter method is used to select the required rows in the Grid dashboard item. To select the required range in the Range Filter dashboard item, the DashboardViewer.SetRange method is used.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-apply-master-filtering-in-dashboardviewer-e5097.
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Collections;
using DevExpress.DashboardCommon;
namespace Dashboard_SetMasterFilter {
public partial class Form1 : Form {
public Form1() {
InitializeComponent();
// Loads a dashboard from an XML file.
dashboardViewer1.LoadDashboard(@"..\..\Data\Dashboard.xml");
// Creates a list with values to be selected in the Grid dashboard item.
List<object> rowValues1 = new List<object>();
rowValues1.AddRange(new[] { "UK", "Anne Dodsworth" } );
List<object> rowValues2 = new List<object>();
rowValues2.AddRange(new[] { "USA", "Andrew Fuller" } );
List<IList> selectedRows = new List<IList>( new[] {rowValues1, rowValues2} );
// Creates a range with specified minimum and maximum values.
DateTime minimumValue = new DateTime(1995, 3, 1);
DateTime maximumValue = new DateTime(1995, 10, 1);
RangeFilterSelection selectedRange = new RangeFilterSelection(minimumValue, maximumValue);
// Selects specified values in the Grid dashboard item.
dashboardViewer1.SetMasterFilter("gridDashboardItem1", selectedRows);
// Selects a specified range in the Range Filter dashboard item.
dashboardViewer1.SetRange("rangeFilterDashboardItem1", selectedRange);
}
}
}