Access to Underlying Widgets in ASP.NET Core
- 2 minutes to read
Tip
This topic shows the ASP.NET Core specifics. The main widget customization concepts are described in the following article: Access to Underlying Widgets in DashboardControl.
Most dashboard items use DevExtreme UI widgets to visualize data. Use the DashboardControl‘s API to access these widgets and customize their settings. In ASP.NET Core, you need to subscribe to the ViewerApiExtension events that allow you to access underlying UI/Data Visualization widgets. For this, use the DashboardBuilder.OnBeforeRender event handler, call the ViewerApiExtension.on method and pass the event name as the method’s parameter.
Several dashboard items use built-in components instead of DevExtreme-based UI widgets.
Layout items do not have underlying components.
See the table in the following topic for information about dashboard items and their underlying components: Access to Underlying Widgets in DashboardControl.
Example
The example shows how to customize options of underlying widgets. Handle the onItemWidgetOptionsPrepared event to do the following:
- The hovered grid row is highlighted in the underlying dxDataGrid.
- A standard tooltip that appears when a user hovers over a chart’s series point is disabled.
- A custom tooltip appears when a user clicks a label on the chart’s argument axis. The onArgumentAxisClick property executes a function that invokes the custom tooltip.
- The animation is enabled for the dxChart and dxPieChart UI components.
- The dxPieChart UI component displays a legend.
- The font weight and an interval between major ticks are modified in the dxCircularGauge UI component.
@page
<div style="position: absolute; left: 0; top: 0; right: 0; bottom: 0;">
@(Html.DevExpress().Dashboard("dashboardControl1")
.Width("100%")
.Height("100%")
.OnBeforeRender("onBeforeRender")
)
</div>