ChartSelectionBehavior SelectionChanged

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    37 posts
    Member since:
    Dec 2012

    Posted 20 Jan 2014 Link to this post

    A few months ago I created a boxplot chart using a slightly modified version of the method outlined here:

    I added the following to the chart's XAML: 

       <telerik:ChartPanAndZoomBehavior ZoomMode="Vertical" PanMode="Vertical"/>
       <telerik:ChartSelectionBehavior DataPointSelectionMode="Single" />
       <telerik:ChartSelectionBehavior SelectionChanged="SelectionChanged" />
    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,

  2. Martin Ivanov
    Martin Ivanov avatar
    1410 posts

    Posted 22 Jan 2014 Link to this post

    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:ChartPanAndZoomBehavior ZoomMode="Vertical" PanMode="Vertical"/>
        <telerik:ChartSelectionBehavior DataPointSelectionMode="Single" SelectionChanged="ChartSelectionBehavior_SelectionChanged" />

    Martin Ivanov
    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 >>
Back to Top