How to: Apply Master Filtering in MVCxDashboardViewer

Note

Starting with v17.1, we recommend using the ASPxDashboard control or a corresponding ASP.NET MVC extension to display dashboards within web applications. Refer to the following KB articles to learn more about migration to ASPxDashboard / ASP.NET MVC Dashboard:

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.

@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()

See Also