ChartControl.ReplaceSelectedItems(Object[]) Method

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

Namespace: DevExpress.XtraCharts

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

Declaration

public void ReplaceSelectedItems(
    params object[] items
)
Public Sub ReplaceSelectedItems(
    ParamArray items As Object()
)

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.

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