RadTreeViewItem with custom template doesn't work with drag and drop

10 posts, 1 answers
  1. mrhaze
    mrhaze avatar
    4 posts
    Member since:
    Mar 2010

    Posted 17 Jun 2011 Link to this post

    When using a custom RadTreeViewItem template (Blend -> Edit Template -> Edit a Copy) drag and drop throws an exception after a few movements in the RadTreeView:

    Exception: InvalidOperationException
    Message : A VirtualizingPanel is not nested in an ItemsControl. VirtualizingPanel must be nested in ItemsControl to get and show items.
      
    Stack trace:
       vid System.Windows.Controls.VirtualizingPanel.getGenerator()
       vid System.Windows.Controls.VirtualizingPanel.get_ItemContainerGenerator()
       vid Telerik.Windows.Controls.TreeView.TreeViewPanel.OnItemsChanged(Object sender, ItemsChangedEventArgs args)
       vid System.Windows.Controls.VirtualizingPanel.OnItemsChangedInternal(Object sender, ItemsChangedEventArgs args)
       vid System.Windows.Controls.VirtualizingPanel.OnItemsChangedHandler(Object sender, ItemsChangedEventArgs args)
       vid System.Windows.Controls.Primitives.ItemsChangedEventHandler.Invoke(Object sender, ItemsChangedEventArgs e)
       vid System.Windows.Controls.ItemContainerGenerator.OnItemAdded(Object item, Int32 index, Boolean suppressEvent)
       vid System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.ICollectionChangedListener.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       vid System.Windows.Controls.WeakCollectionChangedListener.SourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
       vid System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       vid System.Windows.Controls.ItemCollection.NotifyCollectionChanged(NotifyCollectionChangedEventArgs e)
       vid System.Windows.Controls.ItemCollection.InsertImpl(Int32 index, Object value)
       vid System.Windows.PresentationFrameworkCollection`1.System.Collections.IList.Insert(Int32 index, Object value)
       vid Telerik.Windows.Controls.RadTreeView.EndDrop(FrameworkElement dropTarget, IEnumerable draggedItemsEnumerable)
       vid Telerik.Windows.Controls.RadTreeView.OnDropComplete(FrameworkElement dropDestination, IEnumerable draggedItems)
       vid Telerik.Windows.Controls.RadTreeView.OnTreeViewDropInfo(Object sender, DragDropEventArgs e)
       vid Telerik.Windows.Controls.DragDrop.DragDropEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       vid Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       vid Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
       vid Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
       vid Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
       vid Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.DragDropProvider_DropInfo(Object sender, DragDropEventArgs e)
       vid Telerik.Windows.Controls.DragDrop.DragDropProviderBase.RaiseDropInfo()
       vid Telerik.Windows.Controls.DragDrop.SilverlightDragDropProvider.OnDrop()
       vid Telerik.Windows.Controls.DragDrop.SimulatedDragDropProvider.OnCoverRectangleMouseLeftButtonUpInternal()
       vid Telerik.Windows.Controls.DragDrop.SilverlightDragDropProvider.OnCoverRectangleMouseLeftButtonUp(Object sender, EventArgs e)
       vid MS.Internal.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
       vid MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName)
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 17 Jun 2011 Link to this post

    Hello,

     I'm not sure how this is related to RadGridView. Can you clarify? 

    Best wishes,
    Vlad
    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
  4. mrhaze
    mrhaze avatar
    4 posts
    Member since:
    Mar 2010

    Posted 17 Jun 2011 Link to this post

    Crap, wrong forum. Can you move it to the RadTreeView forum?
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 22 Jun 2011 Link to this post

    Hi mrhaze,


    Could you please let us know the exact steps you perform in order to reproduce this issue? A sample video would be highly appreciated. We would also like to know the exact RadControl versions that you use.
    Thank you in advance for your cooperation.

    Greetings,
    Petar Mladenov
    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
  6. mrhaze
    mrhaze avatar
    4 posts
    Member since:
    Mar 2010

    Posted 22 Jun 2011 Link to this post

    The exact steps are mentioned above and the version is 2011.1.606.1040.

    Here is an example project: http://db.tt/dyqqNo2.
  7. Answer
    Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 27 Jun 2011 Link to this post

    Hi mrhaze,

    This appears to be a bug in the RadTreeView. We logged it i our PITS (where you can track its status) and updated your telerik account points as a thanks for your cooperation. As a workaround, you can set a x:Key to this Style and apply it explicitly to every RadTreeViewItem defined in XAML.

    All the best,
    Petar Mladenov
    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
  8. spj11
    spj11 avatar
    18 posts
    Member since:
    Jun 2011

    Posted 05 Apr 2012 Link to this post

    We are running into the same issue with the RadTree and were wondering if you guys can either fix this or share with us a workaround. Here is the stack trace when we hit this issue:

    (Name='tbFilter'); target property is 'Text' (type 'System.String').. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> 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.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 Synapse.Silverlight.UtilizationSnapshot.ViewModels.FilterSelectorForTreeViewModel.Filter(Object parameter)

       at Synapse.Silverlight.UtilizationSnapshot.ViewModels.FilterSelectorForTreeViewModel.set_FilterText(String value)

       --- End of inner exception stack trace ---

       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)

       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)

       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

       at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture)

       at System.Reflection.RuntimePropertyInfo.SetValue(Object obj, Object value, Object[] index)

       at System.Windows.CLRPropertyListener.set_Value(Object value)

       at System.Windows.PropertyAccessPathStep.set_Value(Object value)

       at System.Windows.Data.BindingExpression.UpdateValue().


  9. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 09 Apr 2012 Link to this post

    Hello spj11,

     The mentioned PITS issue says that when you apply an implicit style to the static RadTreeViewItems and perform drag and drop this Exception occurs. In our test projects, applying an explicit Style solves this scenario. Could you please let us know if applying an explicit Style is suitable for you? Thank you in advance.

    All the best,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  10. Trevor
    Trevor avatar
    1 posts
    Member since:
    Oct 2012

    Posted 27 Mar 2014 in reply to Petar Mladenov Link to this post

    Has this issue been fix.  Unable to track bug with provide link.
  11. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 01 Apr 2014 Link to this post

    Hi Trevor,

    Yes this bug is fixed with Q2 2013. With this release we provide a new way for handling drag drop operations by setting:
    telerik:TreeViewSettings.DragDropExecutionMode="New"
    Please check out this help article for more info.

    Regards,
    Petar Mladenov
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
Back to Top
DevCraft banner