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

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

9 Answers 183 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
mrhaze
Top achievements
Rank 1
mrhaze asked on 17 Jun 2011, 07:23 AM
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)

9 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 17 Jun 2011, 07:25 AM
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
0
mrhaze
Top achievements
Rank 1
answered on 17 Jun 2011, 07:27 AM
Crap, wrong forum. Can you move it to the RadTreeView forum?
0
Petar Mladenov
Telerik team
answered on 22 Jun 2011, 01:49 PM
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
0
mrhaze
Top achievements
Rank 1
answered on 22 Jun 2011, 01:57 PM
The exact steps are mentioned above and the version is 2011.1.606.1040.

Here is an example project: http://db.tt/dyqqNo2.
0
Accepted
Petar Mladenov
Telerik team
answered on 27 Jun 2011, 03:01 PM
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
0
spj11
Top achievements
Rank 1
answered on 05 Apr 2012, 05:05 AM
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().


0
Petar Mladenov
Telerik team
answered on 09 Apr 2012, 08:24 AM
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 >>

0
Trevor
Top achievements
Rank 1
answered on 27 Mar 2014, 10:32 PM
Has this issue been fix.  Unable to track bug with provide link.
0
Petar Mladenov
Telerik team
answered on 01 Apr 2014, 10:06 AM
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.

 
Tags
TreeView
Asked by
mrhaze
Top achievements
Rank 1
Answers by
Vlad
Telerik team
mrhaze
Top achievements
Rank 1
Petar Mladenov
Telerik team
spj11
Top achievements
Rank 1
Trevor
Top achievements
Rank 1
Share this question
or