Reputation: 3055
I have a ListBox with a number of ListBoxItem objects. What is the best way to allow users to rearrange the items by dragging and dropping? Do I have to use StackPanels instead? Thanks for any suggestions
Upvotes: 0
Views: 954
Reputation: 3777
For prosperity, the Silverlight Toolkit offers a set of DragDropTarget's
which can be used to reorder items within a ListBox
, TreeView
, or a simple ItemsControl
. You can also drag items between ItemsControls
. Run the Silverligh 4 samples project and look at 'Drag and Drop' under the Toolkit section.
http://silverlight.codeplex.com/
http://www.silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html
The controls you want are:
ListBoxDragDropTarget
TreeViewDragDropTarget
DataPointSeriesDragDropTarget
Upvotes: 0
Reputation: 57469
You are going to use a different listbox control or build your own. Here is an example of building your own. Here is another one where he extends the silverlight toolkit listbox control.
Upvotes: 1