move rows in abrwoser

erwin

New Member
Version 9.1B; In a window I have a smartdataobject, a smartbrowsobject and a up and down button. If I select a row in the smartbrowobject I want to move the row up or down in the smartbrowsobject.

How do I do this ?
 
I suggest you use a calculated field which holds the ordernumber of the specific record. The table is sorted on this record. When you push up, he changes the current record and the above record; when you push down, he changes the currect and the beneith record.
 

mra

Junior???? Member
Hi Erwin!

If you're not using smart panels or smart toolbars where the links can be set up automatically, you have to code the up and down events yourself.

On the Choose trigger of your up button code something like:

on "CHOOSE":U of BtnUp DO:
def var hDataSource as handle no-undo.

{GET dataSource hdataSource h_vViewObject}.

if valid-handle( hDataSource ) then do:
run fetchPrev in hDataSource.
end.
END.

where h_vViewObject is the name for your dataView object or dataBrowse object.

This will select the previous row in the databrowse. This object will in turn synchronize with alle objects linked to it.

Regards
Mike
 
Top