Let’s say I have a class Car like this:
class car
{
string model;
int position;
}
Position is a number from 1 to n, which basically reflects position in the list.
if I have two cars in list they will have positions 1 2.
Now, I’d like to reorder those cars in list in the UI and reflect change in the property for later uses.
So I have a table with several rows:
Car1 1
Car2 2
Car3 3
Car4 4
Now, If I want to reorder items I can drag Car4 and place it at position 2 (right after Car1).
So, my positions will be as follows:
Car1 1
Car4 2
Car2 3
Car3 4
So, what I want to do is to update one item in the list, and all other items will be automatically updated.
I guess something like this: