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

Drag and Drop element - get target TileGroupElement

2 Answers 74 Views
Panorama
This is a migrated thread and some comments may be shown as answers.
Marek Kruk
Top achievements
Rank 1
Marek Kruk asked on 18 Jul 2013, 10:12 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 19 Jul 2013, 01:56 PM
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 >>
0
Marek Kruk
Top achievements
Rank 1
answered on 22 Jul 2013, 12:45 PM
Many thanks, that's what I meant.

Marek
Tags
Panorama
Asked by
Marek Kruk
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Marek Kruk
Top achievements
Rank 1
Share this question
or