Back to Devexpress

ChartControl.SelectedItemsChanging Event

windowsforms-devexpress-dot-xtracharts-dot-chartcontrol-5e6e9869.md

latest4.9 KB
Original Source

ChartControl.SelectedItemsChanging Event

Occurs before the Chart Control’s selected items collection is changed, enabling a handler to cancel the selection change.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.UI.dll

NuGet Package : DevExpress.Win.Charts

Declaration

csharp
public event SelectedItemsChangingEventHandler SelectedItemsChanging
vb
Public Event SelectedItemsChanging As SelectedItemsChangingEventHandler

Event Data

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

PropertyDescription
ActionGets an action which describes how the collection has been changed.
CancelGets or sets the value identifying whether the selection change is canceled.
NewItemsProvides access to a collection of new selected chart elements (series and series points) and business data objects if a Chart Control or a series is bound to a data source.
OldItemsProvides access to previously selected chart elements (series and series points) and business data objects if a Chart Control or a series is bound to a data source.

Remarks

This event fires before the selection is changed. It can be handled to customize the Chart control’s selection. The event’s Cancel parameter that allows you to prevent the chart item from being selected.

The following code snippets (auto-collected from DevExpress Examples) contain references to the SelectedItemsChanging 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-custom-items/CS/TutorialsCustomItems/CustomItems/FunnelItemControlProvider.cs#L26

csharp
chart.SelectedItemsChanged += ChartSelectedItemsChanged;
chart.SelectedItemsChanging += ChartSelectedItemsChanging;
chart.CustomDrawSeriesPoint += CustomDrawSeriesPoint;

winforms-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/Funnel/FunnelItemControlProvider.cs#L27

csharp
chart.SelectedItemsChanged += ChartSelectedItemsChanged;
chart.SelectedItemsChanging += ChartSelectedItemsChanging;
chart.CustomDrawSeriesPoint += CustomDrawSeriesPoint;

winforms-dashboard-custom-items/VB/TutorialsCustomItems/CustomItems/FunnelItemControlProvider.vb#L32

vb
AddHandler chart.SelectedItemsChanged, AddressOf ChartSelectedItemsChanged
AddHandler chart.SelectedItemsChanging, AddressOf ChartSelectedItemsChanging
AddHandler chart.CustomDrawSeriesPoint, AddressOf CustomDrawSeriesPoint

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/Funnel/FunnelItemControlProvider.vb#L33

vb
AddHandler chart.SelectedItemsChanged, AddressOf ChartSelectedItemsChanged
AddHandler chart.SelectedItemsChanging, AddressOf ChartSelectedItemsChanging
AddHandler chart.CustomDrawSeriesPoint, AddressOf CustomDrawSeriesPoint

See Also

ChartControl Class

ChartControl Members

DevExpress.XtraCharts Namespace