We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to programmatically deselect a data point?

Hi

I have a pie and a column chart where when i select a data point another activity is opened. When i use the back button to go back to the chart the data point is still selected. If i try to set SelectedDataPointIndex to -1, which is the value it has before anything is selected, i get an index out of bounds exception.
I could make a bunch of workarounds to achieve the behaviour i want (if you just remove the visuals of the selection, and the user selects the same data point again, it is technically a deselection, which must also be handled accordingly), but it would be much easier and especially cleaner to just deselect the data point. Is there a way to do this?

2 Replies

SP Saravana Pandian Murugan Syncfusion Team April 29, 2016 01:04 PM UTC

Hi Rafael,

We have modified the sample as per your requirement. Please find the sample from the following link.

Sample : http://www.syncfusion.com/downloads/support/forum/123873/ze/MainActivity-458766632

Thanks,
Prabakaran R. 



SP Saravana Pandian Murugan Syncfusion Team April 29, 2016 01:07 PM UTC

Hi Rafael,

We have modified the sample as per your requirement. Please find the sample from the following link.

Sample : http://www.syncfusion.com/downloads/support/forum/123873/ze/MainActivity-458766632  

Thanks,
Saravana Pandian M.

Loader.
Live Chat Icon For mobile
Up arrow icon