This is a migrated thread and some comments may be shown as answers.

ChartSelectionBehavior SelectionChanged

1 Answer 176 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 20 Jan 2014, 10:40 AM
A few months ago I created a boxplot chart using a slightly modified version of the method outlined here: http://www.telerik.com/help/wpf/radchart-howto-create-scatter-errorbars-and-boxplot-series.html

I added the following to the chart's XAML: 

<telerik:RadCartesianChart.Behaviors>
   <telerik:ChartPanAndZoomBehavior ZoomMode="Vertical" PanMode="Vertical"/>
   <telerik:ChartSelectionBehavior DataPointSelectionMode="Single" />
   <telerik:ChartSelectionBehavior SelectionChanged="SelectionChanged" />
</telerik:RadCartesianChart.Behaviors>
At the time this worked perfectly and the SelectionChanged event fired and executed as I wanted. 

While revisiting this code recently I found that the event no longer fires and I've spent quite some time looking through my own code to see if any of my changes could have caused this but have not been able to get the event firing again. However in the intervening time since this was last known to work I updated my Telerik version to 2013.3.1204.40. Are there any known issues in this version which could cause the SelectionChanged event to stop firing?

Thanks for the help,

Andy.

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 22 Jan 2014, 02:21 PM
Hi Andy,

The RadChartView is designed to work only with a single instance of the ChartSelectionBehvaiour and the issue is caused because you are trying to create two instances of this behavior.

This is why in order to fix this you will need to move your SelectionChanged event declaration in your first ChartSelectionBehaviour and remove the last behavior. Take a look at this sample code snippet:
<telerik:RadCartesianChart.Behaviors>
    <telerik:ChartPanAndZoomBehavior ZoomMode="Vertical" PanMode="Vertical"/>
    <telerik:ChartSelectionBehavior DataPointSelectionMode="Single" SelectionChanged="ChartSelectionBehavior_SelectionChanged" />
</telerik:RadCartesianChart.Behaviors>

Regards,
Martin Ivanov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ChartView
Asked by
Andrew
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or