Skip to content

Example of Drag And Drop in ASP.NET MVC ListBox Control

This sample demonstrates the drag and drop functionalities of a ListBox. Select and drag an item and drop it within the same list box or into another list box.

Group A

  • Australia
  • Bermuda
  • Canada
  • Cameroon
  • Denmark
  • France
  • Finland
  • Germany
  • Hong Kong

Group B

  • India
  • Italy
  • Japan
  • Mexico
  • Norway
  • Poland
  • Switzerland
  • United Kingdom
  • United States

The ListBox component allows the user to drag and drop a desired item from one list box into another list box. The drag and drop feature can be enabled by using the following properties,

  • To drag and drop a desired item within the ListBox, the AllowDragAndDrop property should be set to true.
  • To drag and drop between two listboxes, the Scope property should be set to both the listboxes.

In this sample, a list of countries is loaded in Group A and another list of countries is loaded in Group B. You can drag and drop an item or multiple items from Group A to Group B, and vice versa. By clicking update button, user can save the changes to the corresponding JSON using Datamanager saveChanges method.