How can I detect which dataItem user has clicked

Thread is closed for posting
2 posts, 0 answers
  1. shobha
    shobha avatar
    1 posts
    Member since:
    Oct 2008

    Posted 07 Oct 2008 Link to this post

    According to my requirement, whenever the user clicks on particular graph series or hovers,  tool tip should display x-position and y- position at that point.
    Code written by me:


    (ChartSeries collection in chart.Series){
    foreach (ChartSeriesItem item in collection.Items
    item.ActiveRegion.Click +=
    new RegionClickEventHandler(ActiveRegion_Click);



    protected void ActiveRegion_Click(object sender)
    ChartSeriesItem item = (ChartSeriesItem)sender;


    item.ActiveRegion.Tooltip = item.Parent.Name;


    error:Error 212 No overload for 'ActiveRegion_Click' matches delegate 'Telerik.Charting.RegionClickEventHandler' 


  2. Dwight
    Dwight avatar
    475 posts

    Posted 08 Oct 2008 Link to this post

    Hello shobha,

    I have tested your code and no compile-time errors occur. Please, try to locate the error, or send a sample project, that we can analyze and fix.

    Additionally, I suggest handling the RadChart.Click event instead of the RadChartItem.ActiveRegion.Click event. The event arguments provide all the necessary data: Series, SeriesItem, etc. 
    Note, that this event is fired in some other cases, so you need to check if SeriesItem and/or Series are not null.

Back to Top