1
votes
sharepoint - How to perform Drag & Drop between 2 webparts on same page in SP2010 - Stack Overflow
Asked
Viewed 1k times
1

I've 2 webparts on same page i want to perform drag & drop action in between these 2 webparts.

on Left side webpart i have Tree control having nodes & my use case is user can select a node from tree (from left side webpart) & will be able to drag -Drop that node on right webpart & there after i can perform my custom processing by using data associated with that node.

    0

    I'm not sure that this is possible. The native drag and drop will only allow you to move the entire webpart. I have read of some examples using javascript to handle dragging a file onto a web part, so it might be possible to accomplish what you are trying to achieve via javascript.

      0

      On the client side this is really two different chunks of css/javascript/html on a web page. Step back and factor out the SharePoint bits and imagine what you can do with drag and drop with just client side browser techniques. I'm no expert on this but you will find lots of examples of people doing things like this. The javascript of drop target should be able to see what you are sending to it and either handle it directly on the client or be able to raise events in the WebPart that force the PostBack to happen.

        0

        There's no standard solution to do this. Here's a custom solution that was created for SharePoint 2007, but it also works in SharePoint 2010: Extending ASP.NET Webparts: Cross-browser Drag and Drop functionality using JQuery

          Your Answer

          By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

          Not the answer you're looking for? Browse other questions tagged or ask your own question.

           
          3

          3 Answers

          0
          votes

          I'm not sure that this is possible. The native drag and drop will only allow you to move the entire webpart. I have read of some examples using javascript to handle dragging a file onto a web part, so it might be possible to accomplish what you are trying to achieve via javascript.

          0
          votes

          On the client side this is really two different chunks of css/javascript/html on a web page. Step back and factor out the SharePoint bits and imagine what you can do with drag and drop with just client side browser techniques. I'm no expert on this but you will find lots of examples of people doing things like this. The javascript of drop target should be able to see what you are sending to it and either handle it directly on the client or be able to raise events in the WebPart that force the PostBack to happen.

          0
          votes

          There's no standard solution to do this. Here's a custom solution that was created for SharePoint 2007, but it also works in SharePoint 2010: Extending ASP.NET Webparts: Cross-browser Drag and Drop functionality using JQuery