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

Drag from GridView in ChildWindows

2 Answers 58 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Alessandro
Top achievements
Rank 1
Alessandro asked on 23 Dec 2010, 02:52 PM
Hello,
I'm trying to setup drag and drop in a ChildWindow. In this moment all works fine if I drag from a Treeview to listboxs.
I have setup this event handler for the treeview:

RadDragAndDropManager.AddDragInfoHandler(trv, AddressOf OnTrwDragInfo)

And the event handler is the seguent:

Private Sub OnTrwDragInfo(ByVal sender As Object, ByVal e As DragDropEventArgs)
    
If e.Options.Status = DragStatus.DragInProgress Then
        
If e.Options.ParticipatingVisualRoots.Contains(Me) = False Then
            
e.Options.ParticipatingVisualRoots.Add(Me)
        
End If
    
End If
End Sub

I'm trying to do the same thing, but with a GridView as source control.
In the XAML I have edit the style for the GridViewRow:

<Style TargetType="telerik:GridViewRow">
    
<Setter Property="telerik:RadDragAndDropManager.AllowDrag" Value="True" />
</Style>

In code behind I have added the event handler for the GridView too:

RadDragAndDropManager.AddDragInfoHandler(grvItems, AddressOf OnTrwDragInfo)

However the drag and drop doesn't work. In debug I have seen that the when I drag from the GridView, the function OnTrwDragInfo was never called. The treeview (in the same ChildWindow) works fine.

Any ideas?
Thanks,
Alessandro

P.S. I've tested the latest internal buld too, but I have the same problem.

2 Answers, 1 is accepted

Sort by
0
Tsvyatko
Telerik team
answered on 24 Dec 2010, 09:49 AM
Hi Alessandro,

Unlike the TreeView, RadGridView does not have build-in row reorder/drag and this functionality needs to implemented.

I have prepared simple application demonstrating how to achieve this. In it  I am using our new property  - AutoDrag (available in the internal builds and in the upcoming service pack) which simplifies and reduces the code needed to implement drag/drop operations.

Please, have a look at the attachment and let me know if you need any further assistance.

Greetings,
Tsvyatko
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Alessandro
Top achievements
Rank 1
answered on 03 Jan 2011, 11:39 AM
Hello,
Your sample works fine.
However when I try to replicate the drag and drop in my project, the drag and drop doesn't works.

Now in the interface, I see the rows that are dragged, but in debug I have seen that the OnDropInfo event handler it's never called and so I can't complete the drag and drop.

How can I try to fix this problem?
Why the OnDropInfo event handler isn't called?

Thanks,
Alessandro
Tags
DragAndDrop
Asked by
Alessandro
Top achievements
Rank 1
Answers by
Tsvyatko
Telerik team
Alessandro
Top achievements
Rank 1
Share this question
or