Back to Devexpress

DashboardBuilder.OnBeforeRender(String) Method

dashboard-devexpress-dot-dashboardaspnetcore-dot-dashboardbuilder-dot-onbeforerender-x28-system-dot-string-x29.md

latest2.5 KB
Original Source

DashboardBuilder.OnBeforeRender(String) Method

Specifies the JavaScript function (or its name) executed when the BeforeRender event is raised.

Namespace : DevExpress.DashboardAspNetCore

Assembly : DevExpress.Dashboard.v25.2.AspNetCore.dll

NuGet Package : DevExpress.AspNetCore.Dashboard

Declaration

csharp
public DashboardBuilder OnBeforeRender(
    string onBeforeRender
)
vb
Public Function OnBeforeRender(
    onBeforeRender As String
) As DashboardBuilder

Parameters

NameTypeDescription
onBeforeRenderString

A String object containing the JavaScript function (or its name) executed when the event is raised.

|

Returns

TypeDescription
DashboardBuilder

A reference to this instance after the operation has completed.

|

Remarks

Use the BeforeRender event to access the underlying ASP.NET Core wrapper:

cshtml
@(Html.DevExpress().Dashboard()
    .Name("dashboardControl")
    .Width("100%")
    .Height("100%")
    .OnBeforeRender("onBeforeRender")
)

The sender is the Web Dashboard’s underlying client part:

html
<head>
    <script>
        function onBeforeRender(sender) {
            var dashboardControl = sender;
            // Here you can customize a control.
        }
    </script>
</head>

You can now use its API to specify various client-side settings, perform actions, etc. See Client-Side Customization for information on how you can customize the client part of the Web Dashboard control.

See Also

DashboardBuilder Class

DashboardBuilder Members

DevExpress.DashboardAspNetCore Namespace