Lorenzo
Lorenzo

Reputation: 193

ASP.NET drag and drop between 2 listboxes

I have two listboxes on my webpage each containing values of a database. I want to drag one item from listbox1 to listbox2, and then the program should save the new values of listbox2 in the database.

I have no idea how to do that... any help is welcome!

How should I start? I'd like to do it using jQuery... maybe with using the jQuery UI Droppable plugin?

Has anybody a decent tutorial is how to do this?

Thanks in advance!

Upvotes: 2

Views: 2364

Answers (1)

Christophe Geers
Christophe Geers

Reputation: 8962

You could use Telerik's controls for ASP.NET MVC.

They have a treeview control with built-in support for drag and drop. If you want a flat list, don't introduce any children for the treeview. A demo can be found here:

http://demos.telerik.com/aspnet-mvc/treeview/draganddrop

They use jQuery behind the scenes.

If you want to create it yourself, please check out the following video by Chris Pels:

http://msdn.microsoft.com/en-us/scriptjunkie/ff698290

He explains how to build drag & drop functionality using the jQuery and jQueryUI libraries. This should get you started.

Upvotes: 1

Related Questions