I am trying to get around the bug in RadChart when zooming too much so that no data is visible. In that case, the control looses the slider, shows the "No data series" and is unable to zoom out.
The way I approach the problem is that I check the number of points in the DataSeries on DataBound event. For now (and for testing purposes) if there is at least a single data series with 3 or more points, I allow the zoom change.
However, if all data series have less than 3 points, I reset the zoom to 100% (range from 0 to 1).
Here is the code:
sender, ChartDataBoundEventArgs e)
(Chart.DefaultView.ChartArea.DataSeries.Count == 0)
DataSeriesCollection series = Chart.DefaultView.ChartArea.DataSeries;
isZoomValid = series.Any(dSeries => dSeries.Count >= 3);
This code works as it should, regarding the zoom level. When the zoom level reaches the point where there would be less than 3 points in all data series, the zoom will reset to show the complete range in the underlying collection.
However, the slider+s UI is not set to full range. If I click on the slider, it will show the full range, but its UI is not updated by calling SetSelectionRange (nor by manually setting SliderSelectionStart and SliderSelectionEnd) in the DataBound event handler. You can take a look at the video recorded (see this link for the video). Compare the state of the chart at the start. It shows three data series. When I zoom too much, it will reset to the starting state (all three data series visible). However, you will see that the slider remained unchanged. Then I clicked on the slider and it reset its UI to represent the underlying range correctly.
How can I do this UI update in my DataBound event handler, if possible?