In my UI I have a RadChartView, holding some ChartSeries; (in my specific case this is a PolarChart holding a PolarPointSeries).
I have an event which triggers when the user clicks one of the points in this series.
void chart_SelectedPointChanged(object sender, ChartViewSelectedPointChangedEventArgs e)
Using this event, I wish to change the graphical styling of the point that the user selects, at the moment it is selected.
It is straightforward to attain the DataPoint that is clicked by the user via
e.NewSelectedPoint;It is also straightforward to attain the collection of UIChartElements in the plotted series, via
e.NewSelectedSeries.Children;
I can edit the style of any of these plotted UIChartElements, e.g. setting the first one to some image:
e.NewSelectedSeries.Children[0].BackgroundShape.Image = new System.Drawing.Image("MyImage.png");
I then expected I could edit the graphical styling of the particular point selected by the user using the index of the selected DataPoint:
e.NewSelectedSeries.Children[e.NewSelectedPoint.Index].BackgroundShape.Image = new System.Drawing.Image("MyImage.png)
However, the resulting UIChartElement (e.NewSelectedSeries.Children[e.NewSelectedPoint.Index]) does not correspond to the selected DataPoint (e.NewSelectedPoint); it instead corresponds to one of the other DataPoints in the series.
It appears as though the indexing of e.NewSelectedPointSeries.Children does not correspond to the indexing of e.NewSelectedPoint.DataPoints.
Have I misunderstood the API? Is there a better way of accessing the UIChartElement corresponding to a selected point?
For the record, the attempted approach I outline above works correctly with a previous release of Telerik UI for WinForms (2018.1.116.40), but does not work upon upgrading to a newer version (2018.3.1016.40).