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

3D Chart --> Object reference not set ...

7 Answers 109 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Θανάσης
Top achievements
Rank 1
Θανάσης asked on 31 Mar 2010, 03:25 PM
Hi

I have the following code and I'm taking an "Object reference not set ..." when I use Bar3DSeriesDefinition.
But when I set SeriesDefinition to a 2D definition (e.g. BarSeriesDefinition), everything is OK !!!
What I'm doing wrong?

    Dim dt As New DataTable 
    dt.Columns.Add("Year"GetType(String)) 
    dt.Columns.Add("Sales"GetType(Double)) 
    dt.Rows.Add("2007", 37000) 
    dt.Rows.Add("2008", 42000) 
    dt.Rows.Add("2009", 47000) 
    dt.Rows.Add("2010", 44000) 
 
    With Me.RadChart1 
      Dim sm As New SeriesMapping 
      sm.SeriesDefinition = New Bar3DSeriesDefinition 'BarSeriesDefinition  
      sm.ItemMappings.Add(New ItemMapping("Year", DataPointMember.XCategory)) 
      sm.ItemMappings.Add(New ItemMapping("Sales", DataPointMember.YValue)) 
      .SeriesMappings.Add(sm) 
      .ItemsSource = dt 
    End With 
 

7 Answers, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 01 Apr 2010, 01:16 PM
Hello Thanasis,

Can you post the stack trace of the error please?

All the best,
Vladimir Milev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Θανάσης
Top achievements
Rank 1
answered on 06 Apr 2010, 11:00 AM
System.NullReferenceException: Object reference not set to an instance of an object.     at System.Windows.Data.BindingExpression.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)     at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)     at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)     at MS.Internal.InheritanceContextChangedEventManager.OnInheritanceContextChanged(Object sender, EventArgs args)     at System.Windows.DependencyObject.OnInheritanceContextChanged(EventArgs args)     at System.Windows.Media.Media3D.Visual3D.OnInheritanceContextChangedCore(EventArgs args)     at System.Windows.DependencyObject.OnInheritanceContextChanged(EventArgs args)     at System.Windows.Media.Media3D.Visual3D.AddOrRemoveInheritanceContext(DependencyObject newInheritanceContext)     at System.Windows.Media.Media3D.Visual3D.AddInheritanceContext(DependencyObject context, DependencyProperty prop
erty)     at System.Windows.DependencyObject.ProvideSelfAsInheritanceContext(DependencyObject doValue, DependencyProperty dp)     at System.Windows.Media.Media3D.Viewport3DVisual.MS.Internal.IVisual3DContainer.AddChild(Visual3D child)     at System.Windows.Media.Media3D.Visual3DCollection.Add(Visual3D value)     at System.Windows.Media.Media3D.Visual3DCollection.System.Collections.IList.Add(Object value)     at System.Xaml.Schema.XamlTypeInvoker.AddToCollection(Object instance, Object item)     at MS.Internal.Xaml.Runtime.ClrObjectRuntime.Add(Object collection, XamlType collectionType, Object value, XamlType valueXamlType)     at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.Add(Object collection, XamlType collectionType, Object value, XamlType valueXamlType)     at System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentCollection(ObjectWriterContext ctx)     at System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)     at System.Xaml.XamlObjectWriter.WriteEndObject()  
   at System.Xaml.XamlWriter.WriteNode(XamlReader reader)     at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)     at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)     at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)     at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)     at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)     at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)     at System.Windows.FrameworkElement.ApplyTemp
late()     at Telerik.Windows.Controls.Charting.Model`1.get_Element() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\Base\Media3D\Model.cs:line 65     at Telerik.Windows.Controls.Charting.Control3D`1.CheckModelControl() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\Base\Media3D\Control3D.cs:line 481     at Telerik.Windows.Controls.Charting.Control3D`1.TryAddModelElement(ContainerUIElement3D container) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\Base\Media3D\Control3D.cs:line 517     at Telerik.Windows.Controls.Charting.Control3D`1.OnControlContainerChanged() in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\Base\Media3D\Control3D.cs:line 271     at Telerik.Windows.Controls.Charting.Control3D`1.ControlContainerChanged(DependencyObject target, DependencyPropertyChangedEventArgs changedEventArgs) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\Base\Media3D\Control3D.cs:l
ine 457     at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)     at Telerik.Windows.Controls.Charting.Plane3D`1.OnPropertyChanged(DependencyPropertyChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\ChartArea\Axis\Media3D\Planes\Plane3D.cs:line 365     at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)     at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)     at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp)     at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)     at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)     at System.Windo
ws.Data.BindingExpression.Activate(Object item)     at System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)     at System.Windows.Data.BindingExpression.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e)     at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)     at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)     at MS.Internal.InheritanceContextChangedEventManager.OnInheritanceContextChanged(Object sender, EventArgs args)     at System.Windows.DependencyObject.OnInheritanceContextChanged(EventArgs args)     at System.Windows.Media.Media3D.Visual3D.OnInheritanceContextChangedCore(EventArgs args)     at System.Windows.DependencyObject.OnInheritanceContextChanged(EventArgs args)     at System.Windows.Media.Media3D.Visual3D.AddOrRemoveInheritanceContext(DependencyObject newInheritanceContext)     at System.Windows.Media.Media3D.Visual3D.AddInheritanceContext(Dep
endencyObject context, DependencyProperty property)     at System.Windows.DependencyObject.ProvideSelfAsInheritanceContext(DependencyObject doValue, DependencyProperty dp)     at System.Windows.Media.Media3D.Viewport3DVisual.MS.Internal.IVisual3DContainer.AddChild(Visual3D child)     at System.Windows.Media.Media3D.Visual3DCollection.Add(Visual3D value)     at System.Windows.Media.Media3D.Visual3DCollection.System.Collections.IList.Add(Object value)     at System.Xaml.Schema.XamlTypeInvoker.AddToCollection(Object instance, Object item)     at MS.Internal.Xaml.Runtime.ClrObjectRuntime.Add(Object collection, XamlType collectionType, Object value, XamlType valueXamlType)     at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.Add(Object collection, XamlType collectionType, Object value, XamlType valueXamlType)     at System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentCollection(ObjectWriterContext ctx)     at System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)     at S
ystem.Xaml.XamlObjectWriter.WriteEndObject()     at System.Xaml.XamlWriter.WriteNode(XamlReader reader)     at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)     at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)     at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)     at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)     at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)     at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)   
  at System.Windows.FrameworkElement.ApplyTemplate()     at Telerik.Windows.Controls.ItemsControlExtensions.GetItemsPanelRecursive[TPanel](DependencyObject control) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Common\ItemsControlExtensions.cs:line 105     at Telerik.Windows.Controls.ItemsControlExtensions.GetItemsPanel[TPanel](DependencyObject itemsControl) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\Common\ItemsControlExtensions.cs:line 63     at Telerik.Windows.Controls.Charting.ChartArea.OnDataSeriesCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\ChartArea\ChartArea.Core.cs:line 1200     at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)     at Telerik.Windows.Data.RadObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Cor
e\Data\Collections\RadObservableCollection.cs:line 141     at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)     at Telerik.Windows.Data.RadObservableCollection`1.InsertItem(Int32 index, T item) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\RadObservableCollection.cs:line 187     at Telerik.Windows.Controls.Charting.RadHierarchicalObservableCollection`1.InsertItem(Int32 index, T item) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\Data\RadHierarchicalObservableCollection.cs:line 30     at System.Collections.ObjectModel.Collection`1.Add(T item)     at Telerik.Windows.Data.RadObservableCollection`1.AddRange(IEnumerable`1 items) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\RadObservableCollection.cs:line 92     at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData, SeriesMappingCollection seriesMappings, ChartArea chartArea) in c:\Builds\WPF_Scrum\Release_WPF\Sou
rces\Development\Controls\Chart\Chart\RadChart.cs:line 599     at Telerik.Windows.Controls.RadChart.GenerateDataSeries(Object originalData) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\RadChart.cs:line 591     at Telerik.Windows.Controls.RadChart.Rebind(Object originalData) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\RadChart.cs:line 560     at Telerik.Windows.Controls.RadChart.ItemsSourcePropertyChanged(DependencyObject target, DependencyPropertyChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\RadChart.cs:line 472     at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)     at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)     at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)     at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyPropert
y dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)     at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)     at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)     at Telerik.Windows.Controls.RadChart.set_ItemsSource(Object value) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Chart\RadChart.cs:line 208     at ESWpfDashboard.Window1.btn3D_Click(Object sender, RoutedEventArgs e) in D:\ESDev\Framework\ESSessionServer\ESNewDashboard\TestApplicatio\Window1.xaml.vb:line 45

0
Vladimir Milev
Telerik team
answered on 08 Apr 2010, 10:32 AM
Hi Thanasis,

Thanks for the stack trace. However, after inspecting it we tried to reproduce the problem, however, we couldn't manage to cause the exception. I am attaching my sample app code. We would really appreciate it if you can modify it, or otherwise send us a running application which exhibits the problem. Once we are able to repro the bug it will be trivial to fix it.

Regards,
Vladimir Milev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Θανάσης
Top achievements
Rank 1
answered on 08 Apr 2010, 11:41 AM
I'm trying to attach a zip file with the project you are asking, but only image files are accepted in this forum.
How can I send to you this file?
0
Vladimir Milev
Telerik team
answered on 12 Apr 2010, 09:04 AM
Hello Thanasis,

You can open up a support ticket or upload the project file somewhere on a public web server.

All the best,
Vladimir Milev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Θανάσης
Top achievements
Rank 1
answered on 12 Apr 2010, 11:55 AM
OK. Thanks.
The support ticket is 298944
0
Vladimir Milev
Telerik team
answered on 15 Apr 2010, 02:01 PM
Hi Thanasis,

Thanks for the project. There seems to indeed be a problem with RadChart 3D series in WPF 4.0. We are currently investigating the issues. A temporary work-around is to re-target your application to .NET 3.5.

Best wishes,
Vladimir Milev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Chart
Asked by
Θανάσης
Top achievements
Rank 1
Answers by
Vladimir Milev
Telerik team
Θανάσης
Top achievements
Rank 1
Share this question
or