Skip to main content
A newer version of this page is available. .

DashboardControlClientSideEvents Class

Contains a list of the client-side event handlers available for the ASPxDashboard control and a corresponding MVC extension.

Namespace: DevExpress.DashboardWeb

Assembly: DevExpress.Dashboard.v19.1.Web.WebForms.dll

Declaration

public class DashboardControlClientSideEvents :
    CallbackClientSideEventsBase

Remarks

Use the ASPxDashboard.ClientSideEvents and DashboardExtensionSettings.ClientSideEvents properties to get a list of Web Dashboard’s client-side events. These properties return the DashboardControlClientSideEvents object that exposes each client side event handler as a separate property. To handle a particular client-side event, assign a JavaScript function name or the entire code to a corresponding property of the DashboardControlClientSideEvents object.

The examples below demonstrate how to perform an action on the Web Dashboard’s BeforeRender event.

  • Example 1. The code sample below shows how to add a JavaScript code directly in the ASPxClientDashboard.BeforeRender property. The Web Dashboard executes this code before Web Dashboard’s rendering:

    <dx:ASPxDashboard ID="ASPxDashboard1" runat="server" ClientInstanceName="clientDashboard1">
        <ClientSideEvents BeforeRender="function() { // ... }" />
    </dx:ASPxDashboard>
    

    The same code for MVC Dashboard:

    @Html.DevExpress().Dashboard(settings => {
        settings.Name = "Dashboard";
        settings.ClientSideEvents.BeforeRender = "function() { // ... }";
    }).GetHtml()
    
  • Example 2. The code sample below shows how to execute a JavaScript code using the separate function. The onBeforeRender JavaScript function name is assigned to the ASPxClientDashboard.BeforeRender property. When you add the code to the onBeforeRender function, the Web Dashboard executes it before Web Dashboard’s rendering:

    <script type="text/javascript">
        function onBeforeRender(sender) {
            // ...
        }
    </script>
    <dx:ASPxDashboard ID="ASPxDashboard1" runat="server" ClientInstanceName="clientDashboard1">
        <ClientSideEvents BeforeRender="onBeforeRender" />
    </dx:ASPxDashboard>
    

    The same code for MVC Dashboard:

    @Html.DevExpress().Dashboard(settings => {
        settings.Name = "Dashboard";
        settings.ClientSideEvents.BeforeRender = "onBeforeRender";
    }).GetHtml()
    
See Also