For understanding my problem first please see attached file.
When am dragging Order (Order-09 in orderdetail tab of Tour 2) & dropping to Tour 3, am getting reference of Tour 1 instead of Tour 3. Am using Drag & Drop control of Telerik only. DropInfo am handling like below:
If
e.Options.Status = DragStatus.DropComplete Then
Dim row As RadTileViewItem = TryCast(e.Source, RadTileViewItem)
End IF
row am aspacting tour 3 content not Tour 1. This thing happens randomly and am not able to track when it gives me wrong reference.
Solution: if am maximized Tour 3 and again maximized tour 2. if now am dropping same then i am getting tour 3 row which i want.
One thing am doing is While TileStateChanged am checking if it is maximized item then Item Max Height/Width equals to Windows Max Height/Width other wise it restricted to 200 as am want some specific size of box.
Is that the reason or something else?
Thanks...!!!
12 Answers, 1 is accepted
Instead of e.Source, I changed a logic to from CurrentDragPoint find the visual parent. but in that also am not able to find RadTileViewItem. can u please help me out for the same?
Am droping order to TileViewItem Area. row are always nothing even sometime elements also nothing.
If e.Options.Status = DragStatus.DropComplete Then
Dim elements = VisualTreeHelper.HitTest(rtvTour, e.Options.CurrentDragPoint)
Dim row As RadTileViewItem = FindVisualParent(Of RadTileViewItem)(TryCast(elements.VisualHit,
FrameworkElement))
If row IsNot Nothing
' Do something
End If
End if
Private Shared Function FindVisualParent(Of T As UIElement)(ByVal element As UIElement) As T
Dim parent As UIElement = element
While parent IsNot Nothing
Dim correctlyTyped As T = TryCast(parent, T)
If correctlyTyped IsNot Nothing Then
Return correctlyTyped
End If
parent = TryCast(VisualTreeHelper.GetParent(parent), UIElement)
End While
Return Nothing
End Function
Please do needful.... THanks...!!!
from last 2 days am seeking for a solution..can anybody please help?
In order to get the TileViewItem you can use the ParentOfType() method when the drop destination isn't the TileViewItem but an element or panel inside it. And then if the destination RadTileViewItem isn't Nothing, you can apply some custom logic for the drop operation.
Dim
destination
As
RadTileViewItem = TryCast(e.Options.Destination, RadTileViewItem)
If
destination
Is
Nothing
Then
destination = e.Options.Destination.ParentOfType(Of RadTileViewItem)()
End
If
If
e.Options.Status = DragStatus.DropComplete
AndAlso
destination IsNot
Nothing
Then
...
I prepared a sample project illustrating this approach. Please take a look at it and let me know if it works for you.
Best wishes,
Tina Stancheva
the Telerik team
Thanks for reply.
I tested given project but having same problem which am facing. Let me tell you the squence.
1) Type 0 is maximized. Dragging Product 0.0 & Dropping to Type 1 Content area ( not header area).
By doing this Product 0.0 moves to Type 1.
2) Type 1 is maximized. Dragging Product 0.0 & Dropping to Type 2 Content area (not header area).
By doing this Expected result should be item moves to Type 2 Grid.
BUT it moves to Type 0 again.
Same thing happen for me.
Thank you for the calrification. I was able to rerpoduce the issue. We found a way to fix it in the RadDragAndDropManager control. The fix will be available with the internal buld this Friday.
I hope this time frame is acceptable for you.
I also updated your Telerik points accordingly.
Best wishes,
Tina Stancheva
the Telerik team
can u please let me know for this error do you give me any patches or what? to get new updated control what i have to do? can u provide here?
Thanks & Regards
The fix for the issue will be available with the internal build due tomorrow. Once the internal build is out, you can download the updated binaries from the Download section of your account and test the project with them.
Kind regards,
Tina Stancheva
the Telerik team
as you told that internal build you will get it by Friday. but am not got any internal builds. when am opening internal build it says:
No internal builds for your products have been uploaded recently.
Can u please help me out?
Thanks...!!!
In the Downloads section of your account, there is a link to the Free trials section where you can download the latest trial internal build.
Regards,
Tina Stancheva
the Telerik team
Those control for silverlight. and we are talking about WPF. What can i do for that control?
The reason you do not see the latest internal builds for WPF is because they are related to our Q1 2010 RadControls for WPF release and you haven't downloaded it.
Once you download it, you will be able to download the latest internal build as well.
Best wishes,
Tina Stancheva
the Telerik team