Thursday, January 10, 2008

Drag and Drop Inside a ListView (i.e. Reorder ListItems)

Code Project - Manual reordering of items inside a ListView

"ListViewCustomReorder

Introduction

In another community someone asked whether it is possible to implement something like drag&drop inside a ListView.

The person claimed to have searched for an example but didn't find any. Only articles dealing with dragging items into or out of a ListView, but not dragging and dropping items within the same ListView.

This question raised my interest so I built a quick&dirty solution to try it out. After the basics worked I added a few "bells and whistles" (like showing the insertion point in the ListView), but we'll come to this later on.

..."

This is something I've wanted to do too (manually reorder ListView ListItems via drag and drop) but never got around to doing... 

This is a nice article with perfect level of detail and depth (for me at least ;). I really like that he took the extra time to code up the move/insertion location indicator.

No comments: