Possible to drop an item between two other items?

4 posts, 0 answers
  1. Manuel Ruf
    Manuel Ruf avatar
    9 posts
    Member since:
    Apr 2010

    Posted 13 Jul 2012 Link to this post

    I have a TileView with more than one row and I would like to drop an item from the first row between two items on the second row.
    Drag mode "slide" just messes everything up and "swap" is just a straight replacement which is not particularly useful.
  2. Manuel Ruf
    Manuel Ruf avatar
    9 posts
    Member since:
    Apr 2010

    Posted 17 Jul 2012 Link to this post

    I'm guessing it's not possible then..
  3. DevCraft banner
  4. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 17 Jul 2012 Link to this post

    Hi Manuel,

    Indeed the default behavior is to swap or slide the tiles. Basically in the RadTileView control, it's hard to implement a drop between two tiles as you need to determine the positions of the mouse that define a 'drop between two items' and this part can be hard. Moreover you need to get the tile position in which the dragged item should be placed based on the position of the mouse when the drag ends. And if the mouse is between two TileViewItems when the drag operation ends, you won't be able to calculate the new position of the dragged tile.

    However you can implement custom logic in the RadTileView Drag-related events - TileDragStarted, TileDragEnded to customize the default drag drop logic but as I'm not sure what are your exact requirements, I am not sure if the drag/drop operations can be customized to exactly fit your needs. Still, I attached a sample solution demonstrating how to customize the Swap DragMode to place the dragged tile after the item upon which it is dropped thus pushing all other items one position back. I hope this solution can help you in implementing your requirements.

    Greetings,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Manuel Ruf
    Manuel Ruf avatar
    9 posts
    Member since:
    Apr 2010

    Posted 17 Jul 2012 Link to this post

    Sounds promising. Thanks Tina, I'll look into it.
Back to Top