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

Where to handle ShowItemLabels?

1 Answer 42 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jeff Kershner
Top achievements
Rank 1
Jeff Kershner asked on 26 Jul 2010, 04:34 PM
I am handling the RadChart.DataBound event to set the ShotItemlabels to false and the ShowItemToolTips to true, but I am getting a DataSeries = 0 which is causing a crash.

I have a chart declared as a private member in my class:

 

public class TrafficChart : IDomainsTickerChart 
{
private RadChart chart = new RadChart(); 
...
  
public void Initialize() 
{
chart.DataBound += new EventHandler<ChartDataBoundEventArgs>(chart_DataBound); 
...
  
void chart_DataBound(object sender, Telerik.Windows.Controls.Charting.ChartDataBoundEventArgs e) 
{
chart.DefaultView.ChartArea.DataSeries[0].Definition.ShowItemLabels = false; 
   
chart.DefaultView.ChartArea.DataSeries[0].Definition.ShowItemToolTips = true; 
}

 

 


Here DataSeries[0] = null.  Is this how I should set the ShowItemLabels?
Thanks,
--Jeff

1 Answer, 1 is accepted

Sort by
0
Jeff Kershner
Top achievements
Rank 1
answered on 26 Jul 2010, 06:46 PM
I see what is happening.  This chart is in a transition control, and the second time it is displayed, it calls the chart_DataBound when no data is available.

My bad!   Please close this thread!  :)
Tags
General Discussions
Asked by
Jeff Kershner
Top achievements
Rank 1
Answers by
Jeff Kershner
Top achievements
Rank 1
Share this question
or