Re: Sorting

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Jeff Johnson wrote:
Hi,

I'm building the backend of a site for a client and one of the requirements is to add data to populate dropdowns which is straight forward, but they also want to control the order they appear in the dropdowns. I've created a field called 'Sort' using an INT for the datatype. I want to determine the how to swap the 'Sort' field values when the user chooses to to update the order. Can someone please recommend the best way to allow a user to update the sort field?

Name Value Sort
abc ABC 10 (change to 30)
def DEF 20
ghi GHI 30 (change to 10)

Thanks,

Jeff



Of course, you could just execute some SQL.

UPDATE yourtable SET Sort = 10 WHERE Name = 'abc'
UPDATE yourtable SET Sort = 30 WHERE Name = 'ghi'

--
Lasse Vågsæther Karlsen
mailto:lasse@xxxxxxxxxxx
http://presentationmode.blogspot.com/
PGP KeyID: 0xBCDEA2E3
.



Relevant Pages

  • Re: Sorting
    ... Jeff Johnson wrote: ... I'm building the backend of a site for a client and one of the requirements is to add data to populate dropdowns which is straight forward, but they also want to control the order they appear in the dropdowns. ... I want to determine the how to swap the 'Sort' field values when the user chooses to to update the order. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Sorting
    ... Jeff Johnson wrote: ... I'm building the backend of a site for a client and one of the requirements is to add data to populate dropdowns which is straight forward, but they also want to control the order they appear in the dropdowns. ... I want to determine the how to swap the 'Sort' field values when the user chooses to to update the order. ...
    (microsoft.public.dotnet.languages.csharp)
  • Sorting
    ... I'm building the backend of a site for a client and one of the requirements ... is to add data to populate dropdowns which is straight forward, ... field called 'Sort' using an INT for the datatype. ...
    (microsoft.public.dotnet.languages.csharp)