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

[Solved] Drag from one TileView to another

11 Answers 173 Views
TileView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Trude
Top achievements
Rank 2
Trude asked on 09 Jun 2011, 11:12 AM
Is this possible?

11 Answers, 1 is accepted

Sort by
0
Accepted
Zarko
Telerik team
answered on 09 Jun 2011, 05:11 PM
Hi Jorn,
Yes, you can do this with the RadDragAndDropManager -you can read about it here.
I've attached a sample project which implements drag and drop between two RadTileViews so could you please examine it and if you have more questions feel free to ask.

All the best,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Trude
Top achievements
Rank 2
answered on 10 Jun 2011, 11:21 AM
Fantastic! Is there a way to leave the tile behind and only drag the textblock with the arrow?
Edit: Nevermind - I've marked your reply as answered
0
Trude
Top achievements
Rank 2
answered on 15 Jun 2011, 11:44 AM
I added this bit of code to show the dragcue only when the dragged item is above another tileview (since the tile itself is the dragcue before it leaves the container):

If e.Options.Destination IsNot Nothing Then
    Dim dragCue As ContentControl = e.Options.DragCue
    If DirectCast(e.Options.Source, RadTileViewItem).ParentTileView.Name <> e.Options.Destination.Name Then
        dragCue.Visibility = Windows.Visibility.Visible
    Else
        dragCue.Visibility = Windows.Visibility.Collapsed
    End If
End If
0
Trude
Top achievements
Rank 2
answered on 23 Jun 2011, 08:40 AM
Is it possible to only allow the drag operation if the user drags the header element? (as it is now the drag operation is initiated anywhere in the tile)
0
Zarko
Telerik team
answered on 24 Jun 2011, 03:18 PM
Hello Jorn,
You can achieve with a little bit of code behind. You'll have to handle the MouseLeftButtonDown event and check if the user has clicked inside the GripBarElement (this is the area where the default drag and drop occurs) or somewhere else.
Could you please examine the attached project and see if this is what you're looking for?

All the best,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Trude
Top achievements
Rank 2
answered on 10 Oct 2011, 09:29 AM
Hello,

In Q2 SP1 the first sample does not work anymore (I'm using the latest 1004 build).
Execution mode is set to legacy.

When IsItemDraggingEnabled = True (second listview) the the dragcue and arrowcue does not appear until you release the item; then they appear and they are stuck to the cursor until you left click again. Can you please look into this?
0
Trude
Top achievements
Rank 2
answered on 12 Oct 2011, 09:11 AM
Bump!
0
Zarko
Telerik team
answered on 12 Oct 2011, 05:17 PM
Hello Jorn,
There are some changes to the DnDManager and that's why the old example doesn't work very well. To make it work again you have to remove 2 lines of code - in the OnDragQuery and the OnDropQuery methods you have to remove the e.Handled = true.
I've attached the sample with those lines removed so could you please examine it and if you have more questions please feel free to ask.

Kind regards,
Zarko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Trude
Top achievements
Rank 2
answered on 13 Oct 2011, 12:41 PM
The DragCue is still not visible while you drag the tileview! The main difference (I actually didn't spot it before now) is that in Q2 the tileviewitem is visible when dragged outside it's parent tileview; prior to Q2 the tileviewitem disappeared at the border. I need the dragcue visible to tell my users where it's legal to drop the tileviewitem.
0
Trude
Top achievements
Rank 2
answered on 13 Oct 2011, 02:19 PM
Update: the dragcue is only invisible if you drag the tileview by it's header. If you drag it in the middle the dragcue shows.
0
Accepted
Zarko
Telerik team
answered on 14 Oct 2011, 09:36 AM
Hi Jorn,
If you want to see the DragCue when you start to drag by the header you'll have to cancel the default drag and drop in the RadTileView. You can do this by handling the PreviewTileDragStarted event like this:
private void firstTileView_PreviewTileDragStarted(object sender, TileViewDragEventArgs e)
{
    e.Handled = true;
}
Note that in this case you won't have the default TileView DnD.
I've updated the attached project so you could examine it and if you have more questions please feel free to ask.

All the best,
Zarko
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
TileView
Asked by
Trude
Top achievements
Rank 2
Answers by
Zarko
Telerik team
Trude
Top achievements
Rank 2
Share this question
or