iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I want drag Data from WebGrid and drop on unbound WebTreeView. WebGrid and WebTreeView are located in WebPane. Please see attached picture.
Glenn told me few time ago, I have to use DragDropExtender OnDragDrop event handler (not WebTreeView onDragDrop event handler) when using WebPane.
OnDragDrop event (DragDropExtender) has an argument "dropObject". I get the WebTreeview Object with ISGetObject(dropObject.Owner.ControlID). But how can I get the WebTreeViewNode Object?
I have posted a similar request WebGrid with WebDragDropExtender - How can i find out "Drop-Row" to find out on which row OnDragDrop Event is fired.
OnDragDrop event (WebTreeView) has an argument "dropContext". Here I get WebTreeViewNode Object easy with dropContext.ItemObject. I can use this event handler, if I don't define WebTreeView as DropControl in WebDragDropExtender. It works, but the Effect is automaticly set to "Move", if the cursor over a node (else NotAllowed). This means that I can add Childnodes only!
Thanks for help!
Okay, in this case, try to hook the drag query handler to WebDragDropExtender's OnDragQuery instead. I think it'll be fired, although I'm not sure if you can get the "node" in WDDE's event level. However, if you don't need the details in the function handler and simply want to change the Effect, I think that can be done.
Hi Michael,
Thanks for posting about such interesting scenario. Intersoft's drag and drop framework has a very solid architecture which enables better customizability and greater control over the drag and drop process.
In your case, you can continue using OnDragDrop event of WebTreeView since it gives you processed data such as ItemObject. If your struggle is only about the Effect, then here's the good news. You can customize the Effect to your liking by handling OnDragQuery event of WebTreeView.
Here's a snippet code:
function Tree_OnDragQuery(id, dragContext, subObjectContext) { var node = subObjectContext.ItemObject; // change effect to "copy" if (node.Text == "WebUI Studio") dragContext.Effect = ISDragDropEffects.Copy; }
In addition to "Effect", I think you can also customize the effect tooltip that is shown during drag, eg, dragContext.EffectText = "Copy item to WebUI Studio";
Hope this helps,James.
Hi James
Thanks for your answer!
I have tested your code, but it doesn't works. The OnDragQuery Event isn't fired.
It's not enough to change effect, because I can also add Clildnodes only!
Regards
Michael
Have you attached the function to the OnDragQuery client side event in TreeView? Eg, <ClientSideEvents OnDragQuery="Tree_OnDragQuery" />.
The events are fired properly. You can also check a basic sample that demonstrate all drag drop events in installed live sample. Open WebTreeView (C# Samples), then look for DragDropEvents.aspx sample.
Let me know how it goes in your end.
I'm not sure if I got you on this one. WebTreeView should let you drop on just any nodes (parent and child). Let me know if you have other scenarios.
I have tested DragDropEvents.aspx sample. But in my case, I drag from WebGrid and drop on WebTree. Maybe it doesn't work, because I use the WebPaneManager.
In other thread (Bind 2 WebGrids to Dataset -> second post from me), I have described my scenario. Please have a look.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname