Drag And Drop - Rag Grid View

4 posts, 0 answers
  1. Will
    Will avatar
    1 posts
    Member since:
    Oct 2012

    Posted 26 Feb 2014 Link to this post

    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...
  2. Nick
    Admin
    Nick avatar
    593 posts

    Posted 27 Feb 2014 Link to this post

    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
  3. Deniz
    Deniz avatar
    2 posts
    Member since:
    Aug 2013

    Posted 11 Mar 2014 in reply to Nick Link to this post

    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 ?




  4. Nick
    Admin
    Nick avatar
    593 posts

    Posted 11 Mar 2014 Link to this post

    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.

Back to Top