Skip to main content

ChartControl.ReplaceSelectedItems(Object[]) Method

Changes the selection, replacing the currently selected items with the specified selected items.

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.1.UI.dll

NuGet Package: DevExpress.Win.Charts

Declaration

public void ReplaceSelectedItems(
    params object[] items
)

Parameters

Name Type Description
items Object[]

The newly selected items.

Remarks

The array should contain data items when the chart (series are generated automatically) or series is bound to data, or series points when data points are added manually.

Example

The following example shows how to select chart bars according to selected grid rows.

image

private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) {
    var selectedObjects = gridView1.GetSelectedRows().Select(row => gridView1.GetRow(row)).ToArray();
    chartControl1.ReplaceSelectedItems(selectedObjects);
}
See Also