Note that there are some explanatory texts on larger screens.

plurals
  1. POBest way to allow the User to define a Table’s Order?
    text
    copied!<p>Best way to allow the User to define a Table’s Order?</p> <p>We are using SQL Server 2005 and DevExpress controls.</p> <p>We have a table that contains the following:</p> <ol> <li>Process A </li> <li>Process B </li> <li>Process C </li> <li>Report A</li> <li>Report B </li> <li>Report C</li> </ol> <p>We want to allow the user to change the order to anything they want. </p> <p>Here is one example:</p> <ol> <li>Process C</li> <li>Process A</li> <li>Process B</li> <li>Report B</li> <li>Report A</li> <li>Report C</li> </ol> <p>To accommodate this we added a DisplayOrder (INT) field to the table that is maintainted by the our application. </p> <p>Is using an INT field the best solution for a user defined order?</p> <p>Are there any other methods to accomplish this?</p> <p>The reason, I am asking, is in our current application it takes about 1 second to move a row down (or up). I am about to crack open the code to see why it is taking so long and if you Stack Overflow gurus have any good ideas, I might implement them at that time.</p> <p>If you are curious, here is how I believe our application allows editing of the DisplayOrder:</p> <ol> <li>Load the table into a GridView</li> <li>Select a row </li> <li>Clicking a Move Down button (there is also a Move Up button)</li> <li>The Click Event will swap DisplayOrder of the current row with the row underneath it.</li> <li>The change, to both of the records, are written back to the database</li> <li>This takes about 1 second per click (i.e. 10 clicks equal 10 seconds)</li> </ol>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload