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

DragDrop within RadGridView

5 Answers 123 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 24 Aug 2010, 05:45 AM
I am looking for a drag and drop sample for that allows me to reoorder items within a single RadGridView. Many of the examples posted previously are outdated and raise exceptions. The version I am using is 2010.2.812.

I have have tried to adapt the example given for silverlight here: http://www.telerik.com/help/silverlight/raddraganddrop-within-radgridview.html. The functionality is exactly what I am looking for, however I need a WPF version.

Each item contained wihtin the collection bound to the RadGridView has a property, of type int, named Position. In addition to the above, where and how can I update the Position property of the items in the collection once the drop has occurred so that I can get these objects to persist their position change?

5 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 24 Aug 2010, 07:24 AM
Hello David,

We have an up-to-date example for Drag and Drop within RadGridView. Unfortunately it is not available online and you should start our Demos application locally to be able to view it. 


Sincerely yours,
Milan
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
David
Top achievements
Rank 1
answered on 24 Aug 2010, 08:11 AM
Hi MIlan,

I've checked the current demo and there is no example for Drag and Drop witthin a single gridview. Can you zip a version for WPF?
0
Milan
Telerik team
answered on 24 Aug 2010, 10:20 AM
Hello David,

You can download our samples + binaries from here. Once you unpack the archive you will find a folder called Demos. Open ExamplesCS_WPF.sln and run it. Once the application is started navigate to GridView and you will find a sample called Reorder Rows.


Kind regards,
Milan
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
David
Top achievements
Rank 1
answered on 24 Aug 2010, 01:33 PM
HI there. I tried the sample that you referred to in your last post. However when I try to drag an item, I am getting the following exception. This is the similar exception that I have been receiving when I tried to execute the previous examples. It almost seems like a dll issue.

at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.StartDragging() in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\DragDrop\RadDragAndDropManager.cs:line 1083
   at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.TryStartDrag(IMouseEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\DragDrop\RadDragAndDropManager.cs:line 999
   at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.OnTrackedElementMouseMoveInternal(IMouseEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\DragDrop\RadDragAndDropManager.cs:line 949
   at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.OnCoverRectangleMouseMove(Object sender, MouseEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF_2010_Q2_SP1\Sources\Development\Core\Controls\DragDrop\RadDragAndDropManager.cs:line 860
   at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
   at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at Telerik.Windows.Examples.GridView.App.Main() in T:\Development\Resources\RadControls_for_WPF35_2010_2_0812_TRIAL\Demos\Examples\GridView\obj\x86\Debug\App.g.cs:line 48
0
David
Top achievements
Rank 1
answered on 25 Aug 2010, 12:12 AM
In the above post I had executed the reorder rows from the project level. Once I executed the demo from the solution level, the demo worked. Sorry about that.
Tags
DragAndDrop
Asked by
David
Top achievements
Rank 1
Answers by
Milan
Telerik team
David
Top achievements
Rank 1
Share this question
or