0

I've currently got a DataGrid which is bound to a List. This List is populated through a database query. Now, I'd like to be able to select an item in the DataGrid, and move it up or down, and at the same time having it move in the List.

I thought about LinkedLists, because I also need to have the ability of inserting above or below specific spots in the list. However, I've only ever heard of LinkedLists and I'm not even sure where to start. Looking at the MSDN for it, there doesn't seem to be a built in MoveUp()/MoveDown() methods. I figure, if I can move it in the list, then getting it to move in the DataGrid will be simple.

My question is: Is there a way to move items up and down in a LinkedList or List?

PiousVenom
  • 6,888
  • 11
  • 47
  • 86

1 Answers1

0

To move an item in a list, you'll have to remove it and then re-insert it at the desired location:

Generic List - moving an item within the list

Community
  • 1
  • 1
Kenji
  • 61
  • 1
  • 6