This is a tough one to explain, and even tougher to demonstrate. I've tried to build a sample project to demonstrate this issue, but I'm unable to re-create it in my sample.
This only happens in our full-fledged implementation.
The basic setup is as follows:
When the chart is being rendered, it is receiving data from the server and being rendered like so (slightly obfuscated so that object names aren't specific to my project - anywhere you see "My" is a business object name, but other than that, this code is untouched):
Due to the highly dynamic nature of the data, I was forced to use codebehind to setup the chart.
Either way, the following odd behavior occurs:
This chart has clickable data points (the ItemClick event is wired up elsewhere). When any data point is clicked, whether it be a line or bar chart, a new report is retrieved from the server, and the chart is re-rendered.
When re-rendered, the chart automatically puts itself in "user has started zooming with their mouse mode", meaning that the zoom box (the draggable zoom selection area) is drawn. To make matters more odd, by clicking the selection it doesn't actually zoom. The highlight box just disappears.
I have tried everything imaginable to try to fix this issue. Since the only difference between my sample project and the real project is that the Telerik "Vista" theme is used, I'm thinking it may have something to do with that.
I'm at my wits end, however, as to how to workaround the issue.
I have tried the following:
1: Set MyChart.DefaultView.ChartArea.ZoomScrollSettingsX.ScrollMode to ScrollMode.None, then change it back to ScrollMode.ScrollAndZoom after the chart has rendered
2: Tried the above on another thread, where it is set to "None", waits 1 second, then gets set back to ScrollAndZoom. Amazingly, 1 second later, when ScrollAndZoom is turned back on, the highlight box *still* shows up without any user interaction.
3: Tried waiting until the DataBound event is fired before changing the ScrollMode back to ScrollAndZoom - same problem.
4: A host of other attempts which all lead to the same problem.
Whatever is happening, it appears that some flag is set after I clear my chart and either before or after I render the chart that says "the user has started zooming in the ChartArea with their mouse", although this isn't the case. Again, actually clicking to "zoom" does nothing - it seems that this flag just puts it in some kind of "draw the highlight area" mode.
I would even settle on a solution that requires me to use reflection to manually set this flag to false if you can point me towards some internal or private property that I can use to force it.
To confound matters even worse, this problem doesn't manifest itself on every chart render, and despite methodically trying to figure out exactly which sequence of events causes this happen, it seems to be completely random.
I know that this is a difficult one because I cannot produce a sample project. My main goal by posting this is in the hopes that you can point me towards some internal / private property that I can force using Reflection.
[Edit: I should mention that I was originally using Q1 2011 and tried upgrading to Q3 2011, but that didn't fix my problem. Issue still persists in Q3 2011]
[Edit 2: Upon further research and some testing, I've discovered that in Silverlight, it's impossible to set a private property (as opposed to full .NET where this isn't a problem). Using Reflector, I was able to determine that the ChartArea.DragZoomLayerControl has a property called "isDragging", which is private, which I have no way to change with these absurd security restrictions in Silverlight. Any other suggestions would be greatly appreciated.]
Thanks for your time on this difficult one,