I'm exploring how to build a Visual Web Part, that in edit mode, allows me to apply a custom sort order on a list of items.
For simplicity, assume that when I load the web part, I can populate a List<string>
with some values.
When I edit the web part in the edit view of the page it's in, I'd like to allow the user to sort the items however they'd like - ideally using something like http://jqueryui.com/demos/sortable/.
I can check the DesignMode
property of the web part to see if the web part is in design mode, and if so, show an appropriate UI to do the sorting.
However, I can't think of a good mechanism to store the data after sorting it, and more importantly display the data when the web part is no longer in design mode.
I have to also consider what would happen if an item was added/removed to the underlying List<string>
. I would need to reconcile the underlying List<string>
with the data structure that contains the sorted data.
Appreciate any tips, thank you!