DragAndDrop RadGridView, Drag into Grid whitespace

3 posts, 0 answers
  1. Chris
    Chris avatar
    18 posts
    Member since:
    Sep 2014

    Posted 09 Apr 2015 Link to this post

    When using the Telerik example from http://docs.telerik.com/devtools/wpf/controls/dragdropmanager/how-to/howto-draganddrop-within-radgridview.html dragging an item to the empty space in the RadGridView causes the row to go to the top of the list. Is this the desired behavior? Is there a way to disable it?

     I have attached a picture of dragging to the whitespace. The "spike" row is the last row. If I drag the "spike" row to the bottom whitespace, the "spike" row will become the top row in the list.

  2. Chris
    Chris avatar
    18 posts
    Member since:
    Sep 2014

    Posted 09 Apr 2015 in reply to Chris Link to this post

    If I add the following to OnDrop in RowReorderBehaviour.cs it solves the issue.

     

    // this occurs when you drag an item over itself
    if (details.CurrentDraggedItem == details.CurrentDraggedOverItem)
    {
      return;
    }
     
    // this occurrs when you drag an item without ever dragging over another item
    if (details.CurrentDraggedOverItem == null)
    {
      return;
    }

     

  3. UI for WPF is Visual Studio 2017 Ready
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 10 Apr 2015 Link to this post

    Hello Chris,

    Thank you for sharing the solution you found with the community. You can also check the most recent "Reorder Rows" example available with WPF Demos on how to perform row reordering. 

    Regards,
    Dimitrina
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top