Hi,
I noticed a change between using the RadTreeView Q2 2014 sp1 and Q1 2013 controls:
I have some data of many-to-many Users *--* Groups. On load, I display the data Users > Groups. But on a button click I change the display to Groups > Users.
I followed the databinding procedures for hierarchical data in http://www.telerik.com/help/winforms/treeview-data-binding-data-binding-basics.html and http://www.telerik.com/help/winforms/treeview-data-binding-data-binding-basics.html, with success.
(I use EF 6, context.Users.Local.ToBindingList() for the datasource, or context.Groups.Local.ToBindingList(), for the other direction).
In the 2013 version of the control, I was able to just reassign the datasource with no problem during runtime. With the newest version of the control I get this error:
Type: System.NullReferenceException
Target: GetProperties
Exception: Object reference not set to an instance of an object.
Stack Trace: at Telerik.WinControls.UI.BindingProvider.GetProperties(CurrencyManager cm, String childMember, Int32 level)
at Telerik.WinControls.UI.BindingProvider.GetObjectRelationDescriptor(RelationBinding relation, CurrencyManager cm, Int32 level)
at Telerik.WinControls.UI.BindingProvider.RegisterObjectRelation()
at Telerik.WinControls.UI.BindingProvider.Reset()
at Telerik.WinControls.UI.BindingProvider.root_PropertyChanged(Object sender, PropertyChangedEventArgs e)
at Telerik.WinControls.UI.RelationBinding.OnPropertyChanged(String propertyName)
at Telerik.WinControls.UI.RelationBinding.set_DataSource(Object value)
at Telerik.WinControls.UI.BindingProvider.set_DataSource(Object value)
at Telerik.WinControls.UI.RadTreeView.set_DataSource(Object value)
...
I am able to get around this by setting the source to null first:
RadTreeView1.DataSource = Nothing
RadTreeView1.DataSource = context.Groups.Local.ToBindingList()
Is this by design or is there something I am missing here, such as a better way to achieve this behavior?
Thanks,
I noticed a change between using the RadTreeView Q2 2014 sp1 and Q1 2013 controls:
I have some data of many-to-many Users *--* Groups. On load, I display the data Users > Groups. But on a button click I change the display to Groups > Users.
I followed the databinding procedures for hierarchical data in http://www.telerik.com/help/winforms/treeview-data-binding-data-binding-basics.html and http://www.telerik.com/help/winforms/treeview-data-binding-data-binding-basics.html, with success.
(I use EF 6, context.Users.Local.ToBindingList() for the datasource, or context.Groups.Local.ToBindingList(), for the other direction).
In the 2013 version of the control, I was able to just reassign the datasource with no problem during runtime. With the newest version of the control I get this error:
Type: System.NullReferenceException
Target: GetProperties
Exception: Object reference not set to an instance of an object.
Stack Trace: at Telerik.WinControls.UI.BindingProvider.GetProperties(CurrencyManager cm, String childMember, Int32 level)
at Telerik.WinControls.UI.BindingProvider.GetObjectRelationDescriptor(RelationBinding relation, CurrencyManager cm, Int32 level)
at Telerik.WinControls.UI.BindingProvider.RegisterObjectRelation()
at Telerik.WinControls.UI.BindingProvider.Reset()
at Telerik.WinControls.UI.BindingProvider.root_PropertyChanged(Object sender, PropertyChangedEventArgs e)
at Telerik.WinControls.UI.RelationBinding.OnPropertyChanged(String propertyName)
at Telerik.WinControls.UI.RelationBinding.set_DataSource(Object value)
at Telerik.WinControls.UI.BindingProvider.set_DataSource(Object value)
at Telerik.WinControls.UI.RadTreeView.set_DataSource(Object value)
...
I am able to get around this by setting the source to null first:
RadTreeView1.DataSource = Nothing
RadTreeView1.DataSource = context.Groups.Local.ToBindingList()
Is this by design or is there something I am missing here, such as a better way to achieve this behavior?
Thanks,