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

How to get selected item with ChartSelectionBehavior

2 Answers 80 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Alexey
Top achievements
Rank 1
Alexey asked on 14 May 2014, 06:50 PM
Hi
I have RadPieChart with one PieSeries. I've implemented ChartSelectionBehavior and want to know what item was selected. But ChartSelectionBehavior.SelectionChanged event doesn't provide any invormation about selected item.

2 Answers, 1 is accepted

Sort by
0
Alexey
Top achievements
Rank 1
answered on 18 May 2014, 05:01 AM
I've found solution by myself.
In SelectionChanged event for ChartSelectionBehavior use this code to find out current selected item:
var selected = chart.Series[0].DataPoints.Where(x => x.IsSelected).FirstOrDefault();

0
Accepted
Victor
Telerik team
answered on 19 May 2014, 08:00 AM
Hello Alexey,

Thanks for writing.
This solution should work however you can use the API exposed through ChartSelectionBehavior. If you cast the sender argument of the SelectionChanged event to ChartSelectionBehavior you will be able to say behavior.GetSelectedPoints().

Please write again if you have more questions.

Regards,
Victor
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart
Asked by
Alexey
Top achievements
Rank 1
Answers by
Alexey
Top achievements
Rank 1
Victor
Telerik team
Share this question
or