Itemclick event not fired

1 posts, 0 answers
  1. Erwin
    Erwin avatar
    8 posts
    Member since:
    Jun 2011

    Posted 04 Jul 2011 Link to this post

    In the XAML file I have put the Itemclick property in the chartarea tag (of the scattergraph):

      <telerik:ChartArea LegendName="LegendName" 
                                               LabelFormatBehavior="None" 
                                               NoDataString="{Binding [OrderFulfillment], Source={StaticResource strings}}" 
                                               ItemClick="ChartArea_ItemClick">

    In the code behind, I have declared the method as follows:

            public void ChartArea_ItemClick(object sender, ChartItemClickEventArgs e)
            {
                Debug.WriteLine("======================= ChartArea_ItemClick: event fired");
                Debug.WriteLine("======================= ChartArea_ItemClick: " + e.ToString() + sender.ToString());
            }

    In the method that initializes the component, I have added:
    this.RadScatterChart1.DefaultView.ChartArea.ItemClick += new EventHandler<ChartItemClickEventArgs>(ChartArea_ItemClick);

    The applications runs, but I can't get the Itemclick to get fired, wherever I click.

    Is there something missing?

    Erwin

    Solved: this.RadScatterChart1.DefaultView.ChartArea.ItemClick += new EventHandler<ChartItemClickEventArgs> should be done after the context is set, not before.(ChartArea_ItemClick);
Back to Top