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

Binding Annotations error

1 Answer 42 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Brendan
Top achievements
Rank 1
Brendan asked on 15 Nov 2010, 08:03 AM
I have a simple chart who's itemssource is bound to an object which works fine and refreshes accordingly when the object changes. I would like to bind the chart area annotations however whenever the bound itemssource object changes it throws an error. Is there a way to bind the annotations?

Example binding
Binding annotationBinding = new Binding();
KpiTrend.DefaultView.ChartArea.SetBinding(ChartArea.AnnotationsProperty, annotationBinding);

Object reference not set to an instance of an object.
   at Telerik.Windows.Controls.Charting.ChartArea.UpdateAnnotations()
   at Telerik.Windows.Controls.Charting.ChartArea.UpdateChart()
   at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesCollectionChanged(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.ClearItems()
   at Telerik.Windows.Data.RadObservableCollection`1.ClearItems()
   at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.ClearItems()
   at System.Collections.ObjectModel.Collection`1.Clear()
   at Telerik.Windows.Controls.RadChart.ClearDataSeries()
   at Telerik.Windows.Controls.RadChart.Rebind(Object originalData)
   at Telerik.Windows.Controls.RadChart.ItemsSourcePropertyChanged(DependencyObject target, DependencyPropertyChangedEventArgs args)
   at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
   at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
   at System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
   at System.Windows.Data.BindingExpression.SendDataToTarget()
   at System.Windows.Data.BindingExpression.SourcePropertyChanged(PropertyPathListener sender, PropertyPathChangedEventArgs args)
   at System.Windows.PropertyPathListener.RaisePropertyPathStepChanged(PropertyPathStep source)
   at System.Windows.PropertyAccessPathStep.RaisePropertyPathStepChanged(PropertyListener source)
   at System.Windows.CLRPropertyListener.SourcePropertyChanged(Object sender, PropertyChangedEventArgs args)
   at System.Windows.Data.WeakPropertyChangedListener.PropertyChangedCallback(Object sender, PropertyChangedEventArgs args)
   at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   at DmDashboard.UI.Common.BindableObject.NotifyPropertyChanged(String name)
   at DmDashboard.UI.Module.Monitor.PresentationModels.TrendPresentationModel.set_Kpi(Kpi value)
   at DmDashboard.UI.Module.Monitor.Presenters.TrendPresenter.KpiSelected(Object obj)

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 17 Nov 2010, 10:41 AM
Hello Brendan,

We haven't been able to reproduce this issue locally. Please, have a look at the attached sample application which demonstrates how to bind Annotations and also refreshes the source. If you still experience the same issue, please, open a support ticket and attach a modified version of this example or one that reproduces the issue on your side, so that our developers could investigate the cause.

Best wishes,
Nikolay
the Telerik team
See What's New in RadControls for Silverlight in Q3 2010 on Tuesday, November 16, 2010 11:00 AM - 12:00 PM EST or 10:00 PM - 11:00 PM EST: Register here>>
Tags
Chart
Asked by
Brendan
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or