Skip to main content

ChartControl.SetObjectSelection(Object) Method

Selects the specified chart element at runtime.

Namespace: DevExpress.XtraCharts

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

NuGet Package: DevExpress.Win.Charts


public void SetObjectSelection(
    object obj


Name Type Description
obj Object

A Object which specifies the chart element to select.


Use the SetObjectSelection method to implement custom selection of chart elements at runtime. To clear the selection of any chart element, the ChartControl.ClearSelection method should be used.


To enable standard selection of chart elements by end-users at runtime, set the ChartControl.RuntimeSelection property to true.


This example demonstrates how to select a specific object (diagram, axis, series point, etc.) in a Windows Forms chart.

To do this, it is necessary to call the ChartControl.SetObjectSelection method with an object to select as its parameter, and then call the ChartControl.Refresh method.

View Example

using System;
using System.Windows.Forms;
using DevExpress.XtraCharts;

namespace SetSelection {
    public partial class Form1 : Form {
        public Form1() {

        private void btnDiagram_Click(object sender, EventArgs e) {
            // Select a diagram.

        private void btnAxis_Click(object sender, EventArgs e) {
            // Select an axis.

        private void btnSeriesPoint_Click(object sender, EventArgs e) {
            // Select a series point.
            SeriesPoint pointToSelect = this.chartControl1.Series[0].Points[1] as SeriesPoint;
            if (pointToSelect != null) {
See Also