Back to Devexpress

DashboardDesigner.DashboardItemVisualInteractivity Event

dashboard-devexpress-dot-dashboardwin-dot-dashboarddesigner-6e6e90b4.md

latest14.6 KB
Original Source

DashboardDesigner.DashboardItemVisualInteractivity Event

Allows you to provide custom visual interactivity for data-bound dashboard items that support element selection and highlighting.

Namespace : DevExpress.DashboardWin

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

NuGet Package : DevExpress.Win.Dashboard

Declaration

csharp
public event DashboardItemVisualInteractivityEventHandler DashboardItemVisualInteractivity
vb
Public Event DashboardItemVisualInteractivity As DashboardItemVisualInteractivityEventHandler

Event Data

The DashboardItemVisualInteractivity event's data class is DashboardItemVisualInteractivityEventArgs. The following properties provide information specific to this event:

PropertyDescription
DashboardItemNameGets the component name of the dashboard item for which the event was raised. Inherited from DashboardItemVisualInteractivityBaseEventArgs.
DataGets client data visualized within the dashboard item.
EnableHighlightingGets or sets whether to enable highlighting for the current dashboard item. Inherited from DashboardItemVisualInteractivityBaseEventArgs.
SelectionModeGets or sets the selection mode for dashboard item elements.
TargetAxesGets or sets data axes used to perform custom interactivity actions.

The event data class exposes the following methods:

MethodDescription
SetDefaultSelection(AxisPoint)Sets the default selection for the current dashboard item.
SetDefaultSelection(AxisPointTuple)Sets the default selection for the current dashboard item.
SetDefaultSelection(List<AxisPoint>)Sets the default selection for the current dashboard item.
SetDefaultSelection(List<AxisPointTuple>)Sets the default selection for the current dashboard item.

Remarks

The DashboardItemVisualInteractivity event allows you to provide custom visual interactivity for data-bound dashboard items that support element selection and highlighting. This event is raised for dashboard items with disabled master filtering. Visual interactivity for master filter items is already enabled by default. The DashboardDesigner also fires this event when master filtering is applied to the current dashboard item.

Note

Note that for dashboard items with enabled drill-down the DashboardItemVisualInteractivity event is raised on the bottommost drill-down level.

Use the DashboardItemVisualInteractivityBaseEventArgs.DashboardItemName event parameter to obtain the name of the dashboard item for which the event was raised.

The DashboardItemVisualInteractivityEventArgs.TargetAxes property allows you to specify data axes used to perform custom interactivity actions (selection of grid rows, selection and highlighting of chart series points, etc.). The DashboardItemVisualInteractivityEventArgs.Data event parameter returns the MultiDimensionalData object whose members allow you to obtain the available data axes.

To specify the selection mode and manage highlighting, use the DashboardItemVisualInteractivityBaseEventArgs.SelectionMode and DashboardItemVisualInteractivityBaseEventArgs.EnableHighlighting properties respectively. The DashboardItemVisualInteractivityEventArgs.SetDefaultSelection method provides the capability to specify the default selection for the current dashboard item.

After the selection is changed, the DashboardDesigner.DashboardItemSelectionChanged event is raised. Its DashboardItemSelectionChangedEventArgs.CurrentSelection parameter returns the selected elements.

The following table lists possible target axes for each dashboard item and supported interactivity capabilities.

|

Dashboard Item

|

Target Axes

|

Selection

|

Highlighting

| | --- | --- | --- | --- | |

GridDashboardItem

|

DashboardDataAxisNames.DefaultAxis

|

| | |

ChartDashboardItem

|

DashboardDataAxisNames.ChartArgumentAxis

DashboardDataAxisNames.ChartSeriesAxis

|

|

| |

ScatterChartDashboardItem

|

DashboardDataAxisNames.ChartArgumentAxis

|

|

| |

PieDashboardItem

|

DashboardDataAxisNames.ChartArgumentAxis

DashboardDataAxisNames.ChartSeriesAxis

|

|

| |

CardDashboardItem

|

DashboardDataAxisNames.DefaultAxis

|

|

| |

GaugeDashboardItem

|

DashboardDataAxisNames.DefaultAxis

|

|

| |

MapDashboardItem

|

DashboardDataAxisNames.DefaultAxis

|

| | |

TreemapDashboardItem

|

DashboardDataAxisNames.DefaultAxis

|

|

|

Note

A Grid dashboard item with enabled Cell Merging does not support custom interactivity.

Example

This code snippet demonstrates how to handle the DashboardDesigner.DashboardItemVisualInteractivity event to implement custom visual interactivity instead of the built-in master filtering.

View Example: How to Use Dashboard Items in Tab Pages as Independent Master Filters

csharp
using DevExpress.DashboardCommon;
using DevExpress.DashboardCommon.ViewerData;
using DevExpress.DashboardWin;
// ...
        dashboardDesigner1.DashboardItemVisualInteractivity += DashboardDesigner1_DashboardItemVisualInteractivity;
// ...
        private void DashboardDesigner1_DashboardItemVisualInteractivity(object sender, DashboardItemVisualInteractivityEventArgs e)
        {
            if (e.DashboardItemName == "gridDashboardItem1")
            {
                e.SelectionMode = DashboardSelectionMode.Single;
                e.EnableHighlighting = true;
                e.SetDefaultSelection(selectionCache);

            };
            if (e.DashboardItemName == "gridDashboardItem2")
            {
                e.SelectionMode = DashboardSelectionMode.Single;
                e.EnableHighlighting = true;
                e.SetDefaultSelection(selectionCache);
            };
        }
vb
Imports DevExpress.DashboardCommon
Imports DevExpress.DashboardCommon.ViewerData
Imports DevExpress.DashboardWin
' ...
        AddHandler dashboardDesigner1.DashboardItemVisualInteractivity, AddressOf DashboardDesigner1_DashboardItemVisualInteractivity
' ..
        Private Sub DashboardDesigner1_DashboardItemVisualInteractivity(ByVal sender As Object, ByVal e As DashboardItemVisualInteractivityEventArgs)
            If e.DashboardItemName = "gridDashboardItem1" Then
                e.SelectionMode = DashboardSelectionMode.Single
                e.EnableHighlighting = True
                e.SetDefaultSelection(selectionCache)

            End If
            If e.DashboardItemName = "gridDashboardItem2" Then
                e.SelectionMode = DashboardSelectionMode.Single
                e.EnableHighlighting = True
                e.SetDefaultSelection(selectionCache)
            End If
        End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DashboardItemVisualInteractivity event.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-dashboard-designer-custom-interactivity-in-tab-pages/CS/CustomInteractivityExample/Form1.cs#L16

csharp
InitializeComponent();
dashboardDesigner1.DashboardItemVisualInteractivity += DashboardDesigner1_DashboardItemVisualInteractivity;
dashboardDesigner1.DashboardItemSelectionChanged += DashboardDesigner1_DashboardItemSelectionChanged;

winforms-dashboard-designer-custom-interactivity-in-tab-pages/VB/CustomInteractivityExample/Form1.vb#L16

vb
InitializeComponent()
AddHandler dashboardDesigner1.DashboardItemVisualInteractivity, AddressOf DashboardDesigner1_DashboardItemVisualInteractivity
AddHandler dashboardDesigner1.DashboardItemSelectionChanged, AddressOf DashboardDesigner1_DashboardItemSelectionChanged

Implements

DashboardItemVisualInteractivity

See Also

DashboardItemSelectionChanged

Display the Others Slice in the Pie Chart

DashboardDesigner Class

DashboardDesigner Members

DevExpress.DashboardWin Namespace