DashboardItemMouseHitTestEventArgs.GetUnderlyingData(String, IList<String>) Method

Returns underlying data corresponding to the visual element located under the test point.

Namespace: DevExpress.DashboardWin

Assembly: DevExpress.Dashboard.v18.2.Win.dll

Declaration

public DashboardUnderlyingDataSet GetUnderlyingData(
    string axisName,
    IList<string> dataMembers
)
Public Function GetUnderlyingData(
    axisName As String,
    dataMembers As IList(Of String)
) As DashboardUnderlyingDataSet

Parameters

Type Name Description
String axisName

A string value returned by the DashboardDataAxisNames class that specifies the name of the data axis whose dimension values are used to obtain underlying data.

IList<String> dataMembers

A list of String values that specifies data members used to obtain underlying data.

Returns

Type Description
DashboardUnderlyingDataSet

A DashboardUnderlyingDataSet object that represents a list of records from the dashboard data source.

Note that the GetUnderlyingData method does not return data for calculated fields containing the Aggr function.

Examples

The following example demonstrates how to obtain underlying data corresponding to a particular visual element using the DashboardViewer's API.

In this example, the DashboardViewer.DashboardItemDoubleClick event is handled to obtain underlying data and display this data in the grid.

In the event handler, the DashboardItemMouseHitTestEventArgs.GetUnderlyingData method is called to obtain records from the dashboard's data source.

Note

The complete sample project WinViewer - How to obtain a dashboard item's underlying data for a clicked visual element is available in the DevExpress Examples repository.

using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.DashboardWin;
using DevExpress.DashboardCommon;

namespace Dashboard_UnderlyingDataWin {
    public partial class Form1 : XtraForm {
        public Form1() {
            InitializeComponent();
        }

        private void dashboardViewer1_DashboardItemDoubleClick(object sender, 
            DashboardItemMouseActionEventArgs e) {
            XtraForm form = new XtraForm();
            form.Text = "Underlying Data";
            DashboardUnderlyingDataSet underlyingData = e.GetUnderlyingData();

            DataGrid grid = new DataGrid();
            grid.Parent = form; grid.Dock = DockStyle.Fill;
            if (underlyingData != null) {
                grid.DataSource = underlyingData;
            }
            else
                grid.CaptionText = "The grid has no data";
            form.ShowDialog();
            form.Dispose();
        }
    }
}
See Also