Jonathan Wood
5/20/2008 5:16:00 PM
William Vaughn,
> Have you considered a UI that the user might already be familiar with?
> For example, Excel, or Word (tables) where the user can select,drag and
> drop items? This would require less training. Implementation would be a
> matter of managing the DataTable Rows collection and drag-and-drop events.
> That is, the user would select a row to reposition in a DataGridView, your
> UI event handler would highlight the row (changing DataGridView cell/row
> properties) and when the selection was dropped, you would reorg the Rows
> collection and refresh the DataSource to rebind.
Someone else suggested this too. On the negative side, my users are not
generally computer users and there's a possibility they could be confused by
drag and drop. On the positive side, there would only be one database hit to
shift an item several rows. Of course, the bigger issue would be
implementation. I haven't seen anything like this and probably couldn't
justify doing it from scratch.
Thanks.
Jonathan
____________________________________________________________________________________________> "Jonathan Wood" <jwood@softcircuits.com> wrote in messagenews:O3YYgReuIHA.4260@TK2MSFTNGP05.phx.gbl...>> It doesn't not matter how it is implemented. As long as the user cancontrol the order that the items appear.>>>> I know that it is not practical to control the order of rows in aphysical table. I need to control the order that rows are displayed. Thetricky part is an efficient UI that allows the user to control this.>>>> -->> Jonathan Wood>>>>>> "Kerry Moorman" <KerryMoorman@discussions.microsoft.com> wrote in messagenews:E7E0BD6E-20E5-4319-A79E-39CBE035294C@microsoft.com...>>> Jonathan,>>>>>> Do you mean that you need to control the order of rows in a physicaltable>>> in a relational database?>>>>>> Or do you mean that you need to control the order that the rows are>>> displayed to the user?>>>>>> Kerry Moorman>>>>>>>>> "Jonathan Wood" wrote:>>>>>>> I have a requirement to provide users with the ability to control theorder>>>> of items in a table, used by an ASP.NET application.>>>>>>>> Requiring them to enter a number into a new column, which I would thensort>>>> by, is not a valid option as it becomes too messy when they are adding,>>>> deleting, or changing the order of items. Ideally, I would have anUP/DOWN>>>> button for each item, and items would order as created but could thenbe>>>> moved around using these buttons.>>>>>>>> Does anyone have suggestions on an efficient way to implement this? Iwould>>>> really like to minimize the number of database hits in implementingthis.>>>> For example, when writing a new item, I could do a query to return the>>>> highest order value so far and store the new item with a value onehigher.>>>> And then when swapping the order of two items, I'd have to read bothrows,>>>> and then write both rows. I'd love to improve on the efficiency ofthis. I>>>> don't suppose SQL has some sort of command to swap the column values oftwo>>>> different rows.>>>>>>>> Thanks!>>>>>>>> -->>>> Jonathan Wood>>>