In my Application, I've a RadTreeView which is bound to a ObservableCollection. That I could sorting the entries I have implemented a Converter in the ItemsSource of the RadTreeView and in the ItemsSource of the HierarchicalDataTemplate.
Converter:
public
object
Convert(
object
value, Type targetType,
object
parameter, CultureInfo culture)
{
IEnumerable<
object
> counties = value
as
IEnumerable<
object
>;
CollectionViewSource cvs =
new
CollectionViewSource();
cvs.Source = counties;
cvs.SortDescriptions.Add(
new
SortDescription(parameter.ToString(), ListSortDirection.Ascending));
return
cvs.View;
}
If I enable DragDrop on the RadTreeView (IsDragDropEnabled = true) and I Drag & Drop an Entry, I receive a NullReferenceException:
Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Details:
bei Telerik.Windows.Controls.RadTreeView.EndDrop(FrameworkElement dropTarget, IEnumerable draggedItemsEnumerable)
bei Telerik.Windows.Controls.RadTreeView.OnDropComplete(FrameworkElement dropDestination, IEnumerable draggedItems)
bei Telerik.Windows.Controls.RadTreeView.OnTreeViewDropInfo(Object sender, DragDropEventArgs e)
bei Telerik.Windows.Controls.DragDrop.DragDropEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
bei Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
bei Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
bei Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
bei Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
bei Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
bei Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
bei Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.DragDropProvider_DropInfo(Object sender, DragDropEventArgs e)
bei Telerik.Windows.Controls.DragDrop.DragDropProviderBase.RaiseDropInfo()
bei Telerik.Windows.Controls.DragDrop.DragDropProvider.FinishDrag()
bei Telerik.Windows.Controls.DragDrop.DragDropProvider.OnElementDrop(Object sender, DragEventArgs e)
bei Telerik.Windows.DragDrop.DragEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
bei Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
bei Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
bei Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
bei Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
bei Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
bei Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
bei Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
bei Telerik.Windows.DragDrop.DragOperation.RaiseDragEvent(RoutedEvent dragEvent, DependencyObject target)
bei Telerik.Windows.DragDrop.DragOperation.OnDrop(DependencyObject source)
bei Telerik.Windows.DragDrop.DragOperation.DragSourceLostMouseCapture(Object sender, MouseEventArgs e)
bei MS.Internal.CoreInvokeHandler.InvokeEventHandler(UInt32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
bei MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, String eventName, UInt32 flags)
Kind regards,
Bruno