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

Drag And Drop - Rag Grid View

3 Answers 37 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Will
Top achievements
Rank 1
Will asked on 26 Feb 2014, 05:30 PM
Hi, I am trying to drag drop a text file on the
RadGridView cells and I am having some issues. What I am trying to accomplish
is; when I drop the textfile (or any type of file) on a GridCell or
GridHeaderCell , I am going to open another screen for user to enter more
information. That screen will have that file's physical file path and some more
information from the cell which it was dropped on. 

So, regular GridCell is working fine but when I
drop the file on the GridHeaderCell, it does not allow me unless I put a
breakpoint on OnDropQuery method. Without the breakpoint headercells are
not available to drop the file on.



OnDropQuery method is
in MainWindow.xaml.cs. I have a sample project prepared but couldnt attach
it to the thread.



Please let me know, if you need any additional
information. 



Thanks in advance...

3 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 27 Feb 2014, 11:27 AM
Hello Will,

The problem is that the GridViewHeaderRow handles the Drag events internally, to be able to execute actions like column reordering and grouping. The internal logic is based on DragDropManager which leads to some inconsistencies with RadDragAndDropManager. 

Furthermore, RadDragAndDropManager has been marked as Obsolete and will be deleted for Q2 2014, so I strongly recommend migrating your logic to DragDropManager

As to the question at hand, you can subscribe to DragDropManager.DragOver and Drop events to handle external file drops on RadGridView. 

Hope this helps! 

Regards,
Nik
Telerik
0
Deniz
Top achievements
Rank 1
answered on 11 Mar 2014, 01:52 PM
Hi Nik,

I tried to use DragDropManager instead of RadDragDropManager but I still get the same behavior. If I don’t put a break point to OnElementDragOver (DragDropManager.AddDragOverHandler(GridView, OnElementDragOver);) method in MainWindow.xaml.cs , I cannot drop any files to the header. I am attaching a new sample project with DragDropManager code.

Can you please provide a sample project because the online tutorials and/or samples are not really related to what I am trying to accomplish here ?




0
Nick
Telerik team
answered on 11 Mar 2014, 03:36 PM
Hi Will,

You have to subscribe with HandledEventsToo set to true in order to get the internally handled events at your side.

Hope this helps. 

Regards,
Nik
Telerik

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

Tags
GridView
Asked by
Will
Top achievements
Rank 1
Answers by
Nick
Telerik team
Deniz
Top achievements
Rank 1
Share this question
or