This question is locked. New answers and comments are not allowed.
Using the TreeView, I want to have a list of items that can be checked and reordered. I'm using an ItemContainerStyle for binding the CheckState, and a Converter to convert to/from a bool value in my viewmodel. The issue I'm having is when loading the list where some of the items should be defaulting to a CheckState of Toggle.On. If all items have a CheckState of Toggle.Off then there is no exception.
The details of the exception are as follows:
Microsoft JScript runtime error: Unhandled Error in Silverlight Application Object reference not set to an instance of an object. at Telerik.Windows.Controls.TreeView.WeakReferenceKey`1..ctor(T item)
at Telerik.Windows.Controls.RadTreeView.StoreCheckState(RadTreeViewItem container, Object item, ToggleState newCheckState)
at Telerik.Windows.Controls.RadTreeViewItem.OnCheckStatePropertyChanged(DependencyObject sender, 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.InvalidateProperty(DependencyProperty property)
at MS.Internal.FrameworkCallbacks.InvalidateProperty(IntPtr nativeTarget, UInt32 propertyId)
I've created a sample project which easily reproduces this issue (click on the second button to see the exception), and can be downloaded from http://kelly.whitepdx.com/RadControlsSilverlightApp1.zip
NOTE: I've been able to recreate this issue with the following releases:
2011.2.712.1040
2011.2.920.1040
2011.3.1220.1040
I'm unsure of how to fix this, or what method should be used instead.
Kelly White - Microsoft MVP Windows Phone Development
The details of the exception are as follows:
Microsoft JScript runtime error: Unhandled Error in Silverlight Application Object reference not set to an instance of an object. at Telerik.Windows.Controls.TreeView.WeakReferenceKey`1..ctor(T item)
at Telerik.Windows.Controls.RadTreeView.StoreCheckState(RadTreeViewItem container, Object item, ToggleState newCheckState)
at Telerik.Windows.Controls.RadTreeViewItem.OnCheckStatePropertyChanged(DependencyObject sender, 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.InvalidateProperty(DependencyProperty property)
at MS.Internal.FrameworkCallbacks.InvalidateProperty(IntPtr nativeTarget, UInt32 propertyId)
I've created a sample project which easily reproduces this issue (click on the second button to see the exception), and can be downloaded from http://kelly.whitepdx.com/RadControlsSilverlightApp1.zip
NOTE: I've been able to recreate this issue with the following releases:
2011.2.712.1040
2011.2.920.1040
2011.3.1220.1040
I'm unsure of how to fix this, or what method should be used instead.
Kelly White - Microsoft MVP Windows Phone Development