Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

checking valid drop options in virtual tree

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
keesp
Guest





PostPosted: Mon Jun 06, 2005 11:37 am    Post subject: checking valid drop options in virtual tree Reply with quote

Hi there,

I am trying to check whether a dragged object can be inserted in-between rows by performing a check in the onDragOver event:

private void MyClass_DragOver(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Copy; //is more complex of course
return;
}

However, the tree does not allow insertion, only beyond the last row (which appears to be the default behaviour)
How can I implement dropping dat in-between rows?

Thanx,

Kees
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jun 06, 2005 10:40 pm    Post subject: Reply with quote

What type of object are you trying to drop? Are you using ObjectBinding or DatasetBinding? If you are then you would normally set the AllowDropOn, AllowDropAbove and AllowDropBelow properties of the appropriate row bindings to control this and the AllowDrag property of rows that you want to be able to drag.

You can also handle this programmatically by handling the events (or their corresponding methods):

GetAllowRowDrag
GetAllowedRowDropLocations
GetRowDropEffect
RowDrop

The online documentation on "Drag and Drop" (under "Task Based Help" section) provides more information.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
keesp
Guest





PostPosted: Tue Jun 07, 2005 7:38 am    Post subject: drag & drop Reply with quote

Hi,

I've tried to follow the advice on the help area, but the drag & drop events don't seem to get spawned.
What I try to do is drag a TreeNode from another control onto the virtual tree and then, prior to dropping the dragobject, chaeck whether it is allowed to be dropped at that specific location. The mechanism I use is default .NET drag&drop behaviour, so I use the DragOver event to perform a check that sets the DragDropEffect. I have also tried to use the Virtual Tree specific events to achieve the same (like rowdrop etc.), but they don't seem to get activated

In the ( derived class of the) virtual tree I have done:

this.AllowDrop = true;
this.EnableDragSelect = false;

In the rowbinding I have set AllowDropOn = true;

with this, I would expect to be able override some event where I can set the appropriate DragDropEffect, based on the rules I implement there.
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Jun 07, 2005 11:21 am    Post subject: Reply with quote

Is the tree control you are dragging from also a VirtualTree? By default the rowbindings only support dragging within the same tree. You'd need to handle the drop event/methods programmatically if you want to drop between two trees.

This stuff is pretty hard to analyse without some code - if you can forward us a zipped sample project to support@infralution.com, which illustrates what you are trying to do that would help a lot.

Have you had a play with the ADO.NET Dataset Browser sample? This uses standard drag and drop using RowBindings.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group