Topic: change order buttons

Some times you see up and down arrows beside a grid - for example in the auto query for the tablegrid setup,   How do we make these using MVD? 

I've been thinking setting the grid to sort by a column that has a number in it.  and then using a script to swap the values of the items so they sort different.

then I also want to make sure that the rows are numbered from 1 at the top to max at the bottom,  so if I remove an item all the rows with a higher number need to have their value lowered by one.

Is this possible in MVD?   

Attached is my project -
The goal is to have a list of build orders and then calculate a date when each will be finished.
in the attachment is a excel file with macros that does the date calculations but it has its own limitations that are hard to work around.

Post's attachments

Attachment icon forms.zip 480.1 kb, 466 downloads since 2015-06-13 

Re: change order buttons

now that you've had a chance to look at it.

On form1 how can I read the build order number from the grid and then if I click the up button get the build order number of the  item above it
and then write them back to each row in the opposite order and then refresh the grid.


so for example
ID Date        Model       Customer     Serial#     Build Order    etc...
5   6/10/15   AH425      Ray Olton     001238   5
6  6/10/15    AH432      Prairieland   001239   6

I select row 6 and then click the up button it should read line 6 and then 5 and then change the build order values
so that line 5 have 6 as the build order and line 6 should have 5 as the build order and the refresh the grid so it sorts
like this

ID Date        Model       Customer     Serial#     Build Order    etc...
6  6/10/15    AH432      Prairieland   001239   5
5   6/10/15   AH425      Ray Olton     001238   6

I am assuming that I can't just change the database record id so that is why I added the build order id field

Re: change order buttons

Sorry for delay. Done.

Post's attachments

Attachment icon forms_fixed.zip 195.65 kb, 511 downloads since 2015-06-16 

Dmitry.

Re: change order buttons

thanks for the help!