How to: Apply Master Filtering in MVCxDashboardViewer
- 3 minutes to read
Important
This documentation applies to v16.2. Starting with v17.1, the ASPxDashboardViewer control is in maintenance mode. In v19.1, the new Web Dashboard Control replaces the old Web Dashboard Viewer. This means that the Web Dashboard Viewer will not be included in our installation packages. See our blog post for more information.
Refer to the following KB articles to learn how to migrate to ASPxDashboard / ASP.NET MVC Dashboard:
ASPxDashboardViewer -> ASPxDashboard
How to migrate from ASPxDashboardViewer to ASPxDashboard working in the ViewerOnly mode
MVCxDashboardViewer -> MVCxDashboard
How to migrate from DashboardViewerExtension to DashboardExtension working in the ViewerOnly mode
The following example demonstrates how to apply master filtering in MVCxDashboardViewer 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. The SettingsBase.Name property value is used to access the extension client object on the client side.
Click the SetMasterFilter button to apply master filtering.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-apply-master-filtering-in-mvcxdashboardviewer-t134636.
@using (Html.BeginForm()) {
@Html.Action("DashboardViewerPartial")
}
@Html.DevExpress().Button(settings => {
settings.Name = "SetMasterFilterButton";
settings.Text = "SetMasterFilter";
settings.UseSubmitBehavior = true;
settings.ClientSideEvents.Click = "function(s, e) { setMasterFilters(s, e); }";
}).GetHtml()
@Html.DevExpress().Button(settings => {
settings.Name = "ClearMasterFilterButton";
settings.Text = "ClearMasterFilter";
settings.UseSubmitBehavior = true;
settings.ClientSideEvents.Click = "function(s, e) { clearMasterFilters(s, e); }";
}).GetHtml()