Listview reordering position in list oninsert and onchange
basic idea first. I have a table with several fields, the 2 important ones being "ID" and "Postion" . There will only be 4 entries in the table. ( they are links that will go on parts of specific pages).
The position is 1,2,3 or 4.
Things I need to figure out
- How do I limit the maximum number of records to 4? ( more of an mssql question I suppose)
- Ondatabind how do I hide the insert row if there are a total of 4 items in the table. ( to prevent the user from attempting to do so)
- when the user changes the position field of a row to a different number ( using a dropdown list), how do I then reorder the other rows in the table ?
- on the front end the Position field determines the position the links go into an unordered list for display ( jsut so you understand what Im trying to do)
I assume I should somehow indicate that the position row in the table should have distinct/unique values? I will take example but Id prefer tutorials. If you can help with even one piece of this Im glad for the assistance.
In regards to reordering the list, I'm sure it's a common enough task but I don't know what the terminology for the process would be so I didnt have much success with google.
- Im using c# on 4.0 framework