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

Drag And Drop Exception in UserControl

1 Answer 161 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
stas
Top achievements
Rank 1
stas asked on 20 Oct 2011, 01:38 PM
Hello.

I have a simple wpf application based on the RadWindow which contains an UserControl. In the UserControl i have two controls: ListBox and RadScheduleView.  i used very good example from Telerik WPF Demos "RadScheduleView Drag And Drop" section. It works good when everything placed into a Window (or RadWindow). But when i am using UserControl instead of window and i am trying to drag some item from the ListBox i get exception: "Value cannot be null. Parameter name: second"

Stack Trace:

   at System.Linq.Enumerable.Union[TSource](IEnumerable`1 first, IEnumerable`1 second)
   at Telerik.Windows.DragDrop.Behaviors.DragPayload.PartialTrustPayload.GetFormats(Boolean autoConvert) in c:\TB\117\WPF_Scrum\Current_HotFix\Sources\Development\Core\Controls\DragDropManager\Behaviors\Common\DragPayload.cs:line 107
   at System.Windows.DataObject.FormatEnumerator..ctor(DataObject dataObject)
   at System.Windows.DataObject.System.Runtime.InteropServices.ComTypes.IDataObject.EnumFormatEtc(DATADIR dwDirection)

Call Stack:

         [External Code]    
     Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.Behaviors.DragPayload.PartialTrustPayload.GetFormats(bool autoConvert) Line 107 + 0x30 bytes    C#
     [External Code]    
     Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragDropManager.DoDragDrop(System.Windows.DependencyObject dragSource, object data, System.Windows.DragDropEffects allowedEffects, System.Windows.DragDropKeyStates initialKeyState, object dragVisual, System.Windows.Point relativeStartPoint, System.Windows.Point dragVisualOffset) Line 1012 + 0xe bytes    C#
     Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragInitializer.StartDrag() Line 181    C#
     Telerik.Windows.Controls.dll!Telerik.Windows.DragDrop.DragInitializer.DragSourcePreviewMouseMove(object sender, System.Windows.Input.MouseEventArgs e) Line 157    C#
     [External Code]    
     Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.InternalWindow.WindowWithNoChromeWindowHost.Open(bool isModal) Line 35 + 0x19 bytes    C#
     Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.WindowBase.ShowWindow(bool isModal) Line 716    C#
     Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadWindow.ShowDialog() Line 420    C#
>    RadDragDrop.exe!RadDragDrop.MainWindow.MainWindow_Activated(object sender, System.EventArgs e) Line 35 + 0x1e bytes    C#
     [External Code]    

Best Regards,
Stas.

1 Answer, 1 is accepted

Sort by
0
stas
Top achievements
Rank 1
answered on 20 Oct 2011, 02:26 PM
I am sorry. It just works. Please close the thread.
Tags
DragAndDrop
Asked by
stas
Top achievements
Rank 1
Answers by
stas
Top achievements
Rank 1
Share this question
or