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

TreeView + MVVM + themes

1 Answer 92 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Petr
Top achievements
Rank 1
Petr asked on 25 Oct 2010, 07:58 PM
Hi there,
I'm using RadTreeView with MVVM pattern, hierarchical templates, template selectors and everything works great! However, as soon as I set one of your predefined themes to the treeview, any attempt to add new item (new viewmodel object) ends up with the exception listed below. I was hoping that you could have some experience with this issue? And one more thing, is there any way to turn off the virtualization? Setting the IsVirtualizing property to False didn't seem to have any effect here...

Thanks in advance,
Petr


System.InvalidOperationException: A VirtualizingPanel is not nested in an ItemsControl. VirtualizingPanel must be nested in ItemsControl to get and show items.
   at System.Windows.Controls.VirtualizingPanel.getGenerator()
   at System.Windows.Controls.VirtualizingPanel.get_ItemContainerGenerator()
   at Telerik.Windows.Controls.TreeView.TreeViewPanel.OnItemsChanged(Object sender, ItemsChangedEventArgs args)
   at System.Windows.Controls.VirtualizingPanel.OnItemsChangedInternal(Object sender, ItemsChangedEventArgs args)
   at System.Windows.Controls.VirtualizingPanel.OnItemsChangedHandler(Object sender, ItemsChangedEventArgs args)
   at System.Windows.Controls.Primitives.ItemsChangedEventHandler.Invoke(Object sender, ItemsChangedEventArgs e)
   at System.Windows.Controls.ItemContainerGenerator.OnItemAdded(Object item, Int32 index, Boolean suppressEvent)
   at System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.ICollectionChangedListener.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   at System.Windows.Controls.WeakCollectionChangedListener.SourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Windows.Controls.ItemCollection.NotifyCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Windows.Controls.ItemCollection.System.Windows.Controls.ICollectionChangedListener.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Windows.Controls.WeakCollectionChangedListener.SourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)
   at FddGrid.ViewModels.MainViewModel.AddComponent(Object component)

1 Answer, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 28 Oct 2010, 04:29 PM
Hi Petr,

I wasn't able to reproduce this issue. Could you please take a look at the attached project and let me know if I am missing something. I'd be glad to further assist you.

Sincerely yours,
Kiril Stanoev
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
TreeView
Asked by
Petr
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Share this question
or