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

RadChart ChartClickEventHandler Chart Title and Legend Clickable

2 Answers 127 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Katie Arnott
Top achievements
Rank 1
Katie Arnott asked on 25 Mar 2011, 06:01 PM
Is there a way to disable the Chart Title and Chart Legend to NOT be clickable when assigning the Chart a Click event? 

Putting a click event on the item, does not seem to work from code behind.
- item.ActiveRegion.Click += new RegionClickEventHandler(BaseItem_Click);
Item is clickable, but method never gets fired.

I'm using Telerik RadControls for ASP.NET Ajax - version 2010.3.1221.40

Help with any (or both) of the issues above would be greatly appreciated!


Thanks,
Katie

2 Answers, 1 is accepted

Sort by
0
Missing User
answered on 30 Mar 2011, 05:30 PM
Hi Katie Arnott,

 Indeed we must admit that the Item.ActiveRegion.Click event does not work as expected, therefore it is not possible to disable the Chart Title and Chart Legend to not be clickable. I forwarded this issue to our developers for further review.

Your telerik points have been updated.

Greetings,
Polina
the Telerik team
0
Katie Arnott
Top achievements
Rank 1
answered on 30 Mar 2011, 10:07 PM
I have found a workaround in the code behind by using javascript:

xx.Chart.ChartTitle.ActiveRegion.Attributes = "onmouseover=\"this.style.cursor = 'default';\" onmouseout=\"this.style.cursor = 'default';\" onclick=\"return false;\"";
xx.Legend.ActiveRegion.Attributes = "onmouseover=\"this.style.cursor = 'default';\" onmouseout=\"this.style.cursor = 'default';\" onclick=\"return false;\"";
 
you also have to do the same for the legend items and there markers
 
legendItem.ActiveRegion.Attributes = "onmouseover=\"this.style.cursor = 'default';\" onmouseout=\"this.style.cursor = 'default';\" onclick=\"return false;\"";
legendItem.Marker.ActiveRegion.Attributes = "onmouseover=\"this.style.cursor = 'default';\" onmouseout=\"this.style.cursor = 'default';\" onclick=\"return false;\"";


Tags
Chart (Obsolete)
Asked by
Katie Arnott
Top achievements
Rank 1
Answers by
Missing User
Katie Arnott
Top achievements
Rank 1
Share this question
or