simulate item click in a chart

4 posts, 0 answers
  1. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 20 Oct 2010 Link to this post

    Hi, I have this method already defined in my silverlight application:

    public

     

     

    void chart_Service_ItemClick(object sender, ChartItemClickEventArgs e)

     

    {
        my code....
    }

    I need to call this method for simulating an item click in a pie chart, so I'm calling the method chart_Service_ItemClick

    How can I define the e parameter?

    chart_Service_ItemClick(chart_Service, ???)

    In this method I'm using the e parameter, so I can´t send null, I need to define a correct one, could you please tell me how to define my e parameter of type ChartItemClickEventArgs ?

    Thank you.

     

  2. Evgenia
    Admin
    Evgenia avatar
    1406 posts

    Posted 26 Oct 2010 Link to this post

    Hi Chris,

    Unforunately you can't simulate ItemClick event like this. As you know which DataPoint you want to click
    there is no need to simulate ItemClick like this. You can create a method which does the same job which accepts the DataPoint as a parameter, having in mind that every DataPoint knows its DataSeries through the DataSeries property.

    Kind regards,
    Evgenia
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. Chris Thierry
    Chris Thierry avatar
    138 posts
    Member since:
    Jun 2010

    Posted 26 Oct 2010 Link to this post

    Hi Evgenia!
    Do you have an example?
    Thank you.
  5. Carlos Sesma
    Carlos Sesma avatar
    29 posts
    Member since:
    Dec 2008

    Posted 27 Oct 2010 Link to this post

    void ChartArea_ItemClick(object sender, ChartItemClickEventArgs e)
    {
        CheckDataPoint(e.DataPoint);
    }
    void CheckDataPoint(DataPoint mypoint)
    {
        //TODO:add some code
    }
     
    void AlsoCallCheckDataPoint()
    {
        CheckDataPoint(topChart.DefaultView.ChartArea.DataSeries[0].Single(s => (s.DataItem as Company).Name == "AAA"));
    }

    hope this helps.
    regards.
Back to Top