Drag and Drop element - get target TileGroupElement

3 posts, 1 answers
  1. Marek Kruk
    Marek Kruk avatar
    16 posts
    Member since:
    Mar 2009

    Posted 18 Jul 2013 Link to this post

    Hi,
    in my scenario I need to know target TileGroupElement of drag and drop operation.
    I try to use PreviewDragOver event:
    AddHandler RadPanorama1.PanoramaElement.DragDropService.PreviewDragOver, AddressOf PreviewDragOver
    and

    Private Sub PreviewDragOver(sender As Object, e As RadDragOverEventArgs)
          
            'TARGET NAME
            rlabHello.Text = e.HitTarget.GetType.ToString
     
        End Sub
    When I do "Drag Over" RadTileElement I get RadTileElement,  but when I do "Drag Over" TileGroupElement I get RadPanoramaElement.

    How I can get TileGroupElement in both cases?

    Thanks,
    Marek
  2. Answer
    Dess
    Admin
    Dess avatar
    1609 posts

    Posted 19 Jul 2013 Link to this post

    Hello Marek,

    Thank you for contacting Telerik Support.

    You are in the right direction with subscribing for PreviewDragOver event. When "Drag Over" RadTileElement or TileGroupElement you can use the following code snippet to get the TileGroupElement in both cases:
    Private Sub DragDropService_PreviewDragOver(sender As Object, e As Telerik.WinControls.RadDragOverEventArgs)
        Dim location As Point = Me.PointToClient(MousePosition)
        Dim dragTileElement As RadTileElement = TryCast(e.DragInstance, RadTileElement)
     
        Dim overTileElement As RadTileElement = TryCast(dragTileElement.ElementTree.GetElementAtPoint(location), RadTileElement)
        Dim overTileGroupElement As TileGroupElement = TryCast(dragTileElement.ElementTree.GetElementAtPoint(location), TileGroupElement)
        Dim tileGroupElement As TileGroupElement = Nothing
     
        If overTileGroupElement IsNot Nothing Then
            tileGroupElement = overTileGroupElement
        ElseIf overTileElement IsNot Nothing Then
            tileGroupElement = TryCast(overTileElement.Parent.Parent, TileGroupElement)
        End If
     
    End Sub
    I hope this information helps. Please let me know if I can assist you any further with this service request. Thank you in advance.

    Regards,
    Desislava
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Marek Kruk
    Marek Kruk avatar
    16 posts
    Member since:
    Mar 2009

    Posted 22 Jul 2013 Link to this post

    Many thanks, that's what I meant.

    Marek
Back to Top