Drag from GridView in ChildWindows

3 posts, 0 answers
  1. Alessandro
    Alessandro avatar
    12 posts
    Member since:
    Sep 2008

    Posted 23 Dec 2010 Link to this post

    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. Tsvyatko
    Admin
    Tsvyatko avatar
    833 posts

    Posted 24 Dec 2010 Link to this post

    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
  3. DevCraft banner
  4. Alessandro
    Alessandro avatar
    12 posts
    Member since:
    Sep 2008

    Posted 03 Jan 2011 Link to this post

    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
Back to Top