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

Itemclick event not fired

0 Answers 47 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Erwin
Top achievements
Rank 2
Erwin asked on 04 Jul 2011, 12:06 PM
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);

No answers yet. Maybe you can help?

Tags
Chart
Asked by
Erwin
Top achievements
Rank 2
Share this question
or