ASPxClientDashboardViewer.CanSetMasterFilter(String) Method
Returns whether the specified master filter item allows selecting one or more elements.
Namespace: DevExpress.DashboardWeb.Scripts
Assembly: DevExpress.Dashboard.v18.2.Web.WebForms.Scripts.dll
Declaration
Parameters
Name | Type | Description |
---|---|---|
itemName | String | A String that specifies the component name of the master filter item. |
Returns
Type | Description |
---|---|
Boolean | true, if the specified master filter item allows selecting one or more elements; otherwise, false. |
Example
The following example demonstrates how to apply master filtering in ASPxDashboardViewer on the client side.
In this example, the ASPxClientDashboardViewer.SetMasterFilter method is used to select required rows in the Grid dashboard item while the ASPxClientDashboardViewer.SetRange method is called to select the required range in the Range Filter dashboard item. These methods are called in the ASPxClientButton.Click event handler of the ASPxButton1.
Note
Note that in OLAP mode, unique names are used instead of values.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-apply-master-filtering-in-aspxdashboardviewer-e5104.
function setMasterFilters() {
var selectedValues = [['UK', 'Anne Dodsworth'], ['USA', 'Andrew Fuller']];
var selectedRange = new ASPxClientDashboardRangeFilterSelection();
selectedRange.Minimum = new Date(95, 1, 1);
selectedRange.Maximum = new Date(96, 1, 1);
setMasterFilter('gridDashboardItem1', selectedValues);
setRange('rangeFilterDashboardItem1', selectedRange);
}
function clearMasterFilters() {
clearMasterFilter('gridDashboardItem1');
clearMasterFilter('rangeFilterDashboardItem1');
}
function setMasterFilter(itemName, selectedValues) {
if (WebViewer.CanSetMasterFilter(itemName)) {
WebViewer.SetMasterFilter(itemName, selectedValues);
}
}
function setRange(itemName, selectedRange) {
WebViewer.SetRange(itemName, selectedRange);
}
function clearMasterFilter(itemName) {
if (WebViewer.CanClearMasterFilter(itemName)) {
WebViewer.ClearMasterFilter(itemName);
}
}