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

DataBindingHelper Q1 2010 beta release

0 Answers 30 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Niclas Junsved
Top achievements
Rank 1
Niclas Junsved asked on 04 Mar 2010, 09:03 PM
EDIT (SOLVED)

I found out that I had to switch the order of the two rows below:

            this.radChart.ItemsSource = source;
            radChart.SeriesMappings.Add(seriesMapping);

The order above works in Q1 2010 beta. Previousely (Q3 2009) I had it the other way around and it worked fine.

Problem solved!





Hi,

I tested the Q1 2010 dll:s and immedietaly got the following problem with a LineSeriesDefinition graph that previousely worked (sample code follows below the exception details):

{System.NullReferenceException: Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.Charting.DataBindingHelper.IsDateTime(Object value)
   at Telerik.Windows.Controls.Charting.DataBindingHelper.UpdateDataPoint(DataPoint dataPoint, Object value, ItemMapping itemMapping)
   at Telerik.Windows.Controls.Charting.DataBindingHelper.CreateDataSeriesBasedOnRawData(SeriesMapping seriesMapping, QueryableCollectionView dataEngine, Boolean isXValueDateTime, ISeriesDefinition defaultSeriesDefinition)
   at Telerik.Windows.Controls.Charting.DataBindingHelper.ProcessNoGrouping(SeriesMapping seriesMapping, QueryableCollectionView dataEngine, Int32 samplingThreshold, ZoomScrollSettings zoomScrollSettings, ISeriesDefinition defaultSeriesDefinition)
   at Telerik.Windows.Controls.Charting.DataBindingHelper.ProcessGroupingNoAggregation(SeriesMapping seriesMapping, QueryableCollectionView dataEngine, Int32 samplingThreshold, ZoomScrollSettings zoomScrollSettings, ISeriesDefinition defaultSeriesDefinition)
   at Telerik.Windows.Controls.Charting.DataBindingHelper.ProcessGrouping(SeriesMapping seriesMapping, QueryableCollectionView dataEngine, Int32 samplingThreshold, ZoomScrollSettings zoomScrollSettings, ISeriesDefinition defaultSeriesDefinition)
   at Telerik.Windows.Controls.Charting.DataBindingHelper.ProcessMapping(SeriesMapping seriesMapping, QueryableCollectionView dataEngine, Int32 samplingThreshold, ZoomScrollSettings zoomScrollSettings, ISeriesDefinition defaultSeriesDefinition)
   at Telerik.Windows.Controls.Charting.DataBindingHelper.ProcessMappings(SeriesMappingCollection seriesMappings, QueryableCollectionView dataEngine, Int32 samplingThreshold, ZoomScrollSettings zoomScrollSettings, ISeriesDefinition defaultSeriesDefinition)
   at Telerik.Windows.Controls.Charting.DataBindingHelper.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ISeriesDefinition defaultSeriesDefinition, ChartFilterDescriptorCollection globalFilterDescriptors, ChartSortDescriptorCollection globalSortDescriptors, SamplingSettings samplingSettings, ZoomScrollSettings zoomScrollSettings)
   at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ChartArea chartArea)
   at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData)
   at Telerik.Windows.Controls.RadChart.Rebind(Object originalData)
   at Telerik.Windows.Controls.RadChart.NotifyCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   at Telerik.Windows.Data.RadObservableCollection`1.InsertItem(Int32 index, T item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)
   at MIQ.SilverlightExtension.Dashboard.wsproxySetMonGraph_GetRegionByMonthsCompleted(Object sender, GetRegionByMonthsCompletedEventArgs e)
   at MIQ.SilverlightExtension.SilverlightWCFService.SilverlightServiceClient.OnGetRegionByMonthsCompleted(Object state)}

And part of the code:

SeriesMapping seriesMapping = new SeriesMapping(); 
seriesMapping.ItemMappings.Clear(); 
radChart.SeriesMappings.Clear(); 
seriesMapping.SeriesDefinition = new LineSeriesDefinition(); 
seriesMapping.SeriesDefinition.ShowItemLabels = false
            
seriesMapping.GroupingSettings.GroupDescriptors.Add(new ChartGroupDescriptor("ValueType")); 
 
seriesMapping.ItemMappings.Add(new ItemMapping("Month", DataPointMember.XCategory)); 
            seriesMapping.ItemMappings.Add(new ItemMapping("Value", DataPointMember.YValue)); 







A LOT OF CODE INBETWEEN AND THE CRASHES ON

radChart.SeriesMappings.Add(seriesMapping); 


Best Regards

Niclas Junsved

No answers yet. Maybe you can help?

Tags
Chart
Asked by
Niclas Junsved
Top achievements
Rank 1
Share this question
or