I am converting a desktop accounting app to a web app. The old app has a feature that allows a user to change the order of accounts by displaying accounts in a listbox with up and down buttons off to the side. Clicking one of the buttons moves the selected account up or down in the list quickly using the Sort method. WebListBox lacks the Sort method. I have considered simply reloading the listbox in the new order but worry that the delay will cause problems for users if they click up or down multiple times. I think there may be a way to do it with Javascipt, but have no idea how to do it.
Hi Dean,
Check out ‘SortTypes’, that might be what you 're looking for…
For i As Integer = 0 to Me.ColumnCount -1
Me.ColumnSortTypeAt(i) = WebListBox.SortTypes.Unsortable
Next
Actually, I don’t want to do a normal sort. What I am doing is swapping the values of two rows in the list box using the CellTextAt. If this is done in the browser with Javascipt, I am OK. If the code executes on the server and gets sent back to the browser, I am worried that users may have hit the Up button multiple times that will be lost.
Maybe you can introduce sort of a locking / flag mechanism.
While the listbox is being sorted, multiple click for the sorting request is not entertained.
That way the sorting can be done at the server without involving the risk that you mentioned just now.
Just an opinion.