TreeView + MVVM + themes

2 posts, 0 answers
  1. Petr
    Petr avatar
    8 posts
    Member since:
    Aug 2010

    Posted 25 Oct 2010 Link to this post

    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)
  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 28 Oct 2010 Link to this post

    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
  3. DevCraft banner
Back to Top