Friday, February 5, 2010

Drag And Drop Item in ListBox in WPF


In this article we will see how we achieve Drag and Drop behaviour for ListBox Item.

Creating WPF Project

Fire up Visual Studio 2008 and create a new WPF Project. Name it as DragDropListBoxSample.


Basic idea of our sample application is to have two ListBox and we would provide Drag item from First ListBox and Drop into the Second ListBox.

So let's have two ListBox and name the ListBoxes as lbOne, lbTwo.

The following is the basic design how our application would look like.


Here what we would list in the First ListBox. A list of TimeZones from the class TimeZoneInfo.

See full details: