Access to Underlying Widgets

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 Web Viewer uses DevExtreme widgets to visualize data within dashboard items. If necessary, you can access these widgets and customize their settings to add specific capabilities.

The ASPxClientDashboardViewer exposes the following events that allow you to access these widgets and customize their settings.

The ASPxClientDashboardItemWidgetEventArgs.ItemName event parameter returns the component name of the dashboard item whose widget may be customized. Use the ASPxClientDashboardItemWidgetEventArgs.GetWidget method to access the corresponding underlying widget.

The following table lists dashboard items whose underlying widgets may be accessed when handling the ItemWidget... events.

Dashboard Item

Underlying Widget(s)

GridDashboardItem

dxDataGrid

ChartDashboardItem

ScatterChartDashboardItem

dxChart

PieDashboardItem

an array of dxPieChart widgets

GaugeDashboardItem

an array of dxCircularGauge or dxLinearGauge widgets

MapDashboardItem

dxVectorMap

PivotDashboardItem

dxPivotGrid

ComboBoxDashboardItem

dxSelectBox or dxTagBox

ListBoxDashboardItem

dxList

TreeViewDashboardItem

dxTreeList

Note

Note that the dxTreeView widget is used in v17.1 and earlier.

TreemapDashboardItem

dxTreeMap

RangeFilterDashboardItem

dxRangeSelector

CardDashboardItem

CardWidget

TextBoxDashboardItem

n/a See Note

ImageDashboardItem

n/a See Note

CustomDashboardItem

n/a See Note

Note

The content of the TextBoxDashboardItem and ImageDashboardItem are an HTML element wrapped to a jQuery object.

Note

The CustomDashboardItem is a custom widget you can customize directly.

Limitations

Note that changing specific control settings may lead to various issues, thus changing the following settings is nor recommended:

  • data binding settings;
  • basic data presentation settings (for instance, a set of grid columns or chart series).
Note

Note that printed or exported documents containing a dashboard/dashboard item do not reflect appearance settings applied using the events meant for accessing underlying controls.

Example

This example demonstrates how to customize client widgets used to visualize data within dashboard items at runtime using ASPxClientDashboardViewer's API.

The following options are changed:

Imports System
Imports DevExpress.DashboardWeb
Imports DevExpress.DataAccess.ConnectionParameters

Namespace Dashboard_WidgetAccess_Web
    Partial Public Class WebForm1
        Inherits System.Web.UI.Page

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

        End Sub

        Protected Sub ASPxDashboardViewer1_ConfigureDataConnection(ByVal sender As Object, _
                                           ByVal e As ConfigureDataConnectionWebEventArgs)
            If e.ConnectionName = "nwindConnection" Then

                ' Gets connection parameters used to establish a connection to the database.
                Dim parameters As Access97ConnectionParameters = CType(e.ConnectionParameters,  _
                    Access97ConnectionParameters)
                Dim databasePath As String = Server.MapPath("App_Data/nwind.mdb")

                ' Specifies the path to a database file.                    
                parameters.FileName = databasePath
            End If
        End Sub
    End Class
End Namespace

See Also