Back to Devexpress

ChartControl.ClearSelection() Method

windowsforms-devexpress-dot-xtracharts-dot-chartcontrol-8deaaa69.md

latest3.8 KB
Original Source

ChartControl.ClearSelection() Method

Deselects all chart elements at runtime.

Namespace : DevExpress.XtraCharts

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

NuGet Package : DevExpress.Win.Charts

Declaration

csharp
public void ClearSelection()
vb
Public Sub ClearSelection

Remarks

Use the ClearSelection method to implement custom selection of chart elements at runtime. This method deselects an element if it’s selected or hot-tracked. To select any chart element, the ChartControl.SetObjectSelection method should be used.

Note

To enable standard selection of chart elements by end-users at runtime, use the ChartControl.Selection property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ClearSelection() method.

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#L73

csharp
{
    chart.ClearSelection();
    foreach (DashboardFlatDataSourceRow item in selection.GetDashboardFlatDataSourceRows(flatData))

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

csharp
stopEvent = true;
chart.ClearSelection();
foreach (DashboardFlatDataSourceRow item in selection.GetDashboardFlatDataSourceRows(flatData))

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

vb
Protected Overrides Sub SetSelection(ByVal selection As CustomItemSelection)
    chart.ClearSelection()
    For Each item As DashboardFlatDataSourceRow In selection.GetDashboardFlatDataSourceRows(flatData)

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

vb
stopEvent = True
chart.ClearSelection()
For Each item As DashboardFlatDataSourceRow In selection.GetDashboardFlatDataSourceRows(flatData)

See Also

SetObjectSelection(Object)

ChartControl Class

ChartControl Members

DevExpress.XtraCharts Namespace