View previous topic :: View next topic |
Author |
Message |
WolfenSteed
Joined: 15 Feb 2006 Posts: 7 Location: San Diego
|
Posted: Tue Feb 21, 2006 7:17 pm Post subject: Drag & Drop results in "Getting AllowedDropLocation |
|
|
I am having trouble with some of the drag features of the virtual tree.
When I am in the Virtual Tree Editor and I try to drag a column (to reposition it) I get a "Getting AllowedDropLocation" modal dialog box. I have to hit the enter key to hide this dialog box because the mouse cannot click the "ok" button. The same thing started happening to my project when I added the GetAllowedRowDropLocations event handler. I seems to happen between the GetAllowedRowDropLocations and the GetRowDropEffect events.
??? help _________________ Walt :)
Nothing is too small to know, and nothing is too big to attempt. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Tue Feb 21, 2006 11:52 pm Post subject: |
|
|
That's very strange. We don't have any code that shows a modal dialog and none that contains that string. The columns editor also doesn't use Virtual Tree (the bindings editor does). Have you searched your own code for this dialog? Even if you had overriden the GetAllowedDropLocation method and showed the dialog I would not expect it to be displayed from within the VirtualTree editor as this uses the original VirtualTree class to display the bindings.
Maybe you could post the actual image of the dialog displayed. _________________ Infralution Support |
|
Back to top |
|
|
WolfenSteed
Joined: 15 Feb 2006 Posts: 7 Location: San Diego
|
Posted: Wed Feb 22, 2006 7:07 pm Post subject: Drag & Drop |
|
|
The error was coming from our code. We had stubbed the code while trying to troubleshoot some drag and drop problems. We have been having trouble draging an object and dropping it on another object with a different parent type. That is, if an object (lets say subClass1) is a child of another object of the same type (subClass1), we are unable to drop it onto an object of type subClass2. The arrow shows up as the DropNone.ico, however, if the object is already a child of a subClass2 object, it can be dropped onto any subClass2 object.
Is there any limitation that you know of that would prevent dropping to a different type of object?
Hope that made sense.
Thanks for the help. _________________ Walt :)
Nothing is too small to know, and nothing is too big to attempt. |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Wed Feb 22, 2006 10:06 pm Post subject: |
|
|
I assume that you are using ObjectBindings with the inbuilt drag and drop support - is that right? The Object Bindings determine what the allowable drop locations are by looking at RowBinding associated with both the rowbeing dropped and the target row.
To be able to drop an row on another the target rows parent must use the same RowBinding as the dragged rows parent. You can change the allowable locations by handling the GetAllowedRowDropLocations event yourself eg
Code: |
Private Sub VirtualTree_GetAllowedRowDropLocations(ByVal sender As Object, ByVal e As GetAllowedRowDropLocationsEventArgs) Handles VirtualTree.GetAllowedRowDropLocations, VirtualTree1.GetAllowedRowDropLocations
Dim dropRows As Row() = e.Data.GetData(GetType(Row()))
If Not dropRows Is Nothing Then
' determine if you want to allow the given rows to be dropped on e.Row
End If
End Sub
|
You may also need to handle the RowDrop event to then actually perform the drop.
Note that the next minor release will fix some issues with ObjectBinding drag and drop. It will prevent you dropping a parent onto one of its children or grandchildren. _________________ Infralution Support |
|
Back to top |
|
|
|