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

RadTileView Photo movement

1 Answer 77 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 11 Sep 2017, 06:42 AM

Hi, 

I am using the RadTileView to load photos and I set the dragmode to slide, but what happens was, when you drag a photo into a different position the other photos moves in different direction as long there is a vacant slot. Is there a way to control the movement of the other objects(photos) in one direction? let say move side ways going to the right.

 

Thank you

 

Paul Villarin

 

 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 13 Sep 2017, 03:32 PM
Hi Paul,

Thank you for your interest in RadTileView control.

The control doesn't support this type of ordering out of the box when you drag a tile view item. You can take a look at the Reordering Tiles help article in our documentation where this feature is further described. However, in order to achieve your requirement, you can implement custom ordering logic. 
A possible approach could be to do the following:
  • First you can disable the reordering animation (IsItemsAnimationEnabled = "False") and change the drag mode (DragMode = "Swap").
  • Then you can handle the following events: TileDragStarted, PreviewTilePositionChanged, and TileDragEnded to customize the default dragging logic.
  • The TileDragStarted event will set the initial position of the dragged item(DragedElementInitialPosition).
  • The PreviewTilePositionChanged event will set the new position of the dragged item ().
  • The TileDragEnded event will trigger when the item is dropped and will reorder the items so this is the place to customize the reordering.
I am attaching sample project which demonstrates this approach. I think this project is good starting point for implementing your final behavior. Please note that with those implementations you will lose the default animation of the tile view. If this doesn't work for you, you can implement your own custom drag and drop logic with our DragDropManager.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
TileView
Asked by
Paul
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or