Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ChartControl.ReplaceSelectedItems(Object[]) Method

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

Namespace: DevExpress.XtraCharts

Assembly: DevExpress.XtraCharts.v24.2.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.

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