Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powerbuilder "RowsMove" not working for simultaneous selected rows

Status
Not open for further replies.

zaeem143

Programmer
Sep 17, 2015
1
US
Please help me. I am a beginner.
I have a problem that I have written a code in which a button check for the row either it is selected or not. And if it is selected then it Moves the row from one Datawindow to another. But the problem is;
When I move single row it works fine.
While it also move multi rows which are having a row space in between rows. i.e. 1,3,6 or 2,6,8

????? And when I select multiple rows simultaneously then it moves only single row. i.e. Row# 1,2 or 2,3,4 ?????

My code is:

boolean result
for sRow = 1 to dw_lhr.rowCount()
result = dw_lhr.IsSelected(sRow)
IF result THEN
dw_lhr.RowsMove(sRow, sRow, Primary!, dw_grn, 1, Primary!)
END IF
next

 
Since you are moving a row from the dw_lhr datawindow, the rowcount changes once the first row has been moved.

You might be better off using a loop with the GetSelectedRow method.

Something like

[pre]result = dw_lhr.GetSelectedRow(0)
DO WHILE result > 0
dw_lhr.rowsmove(result, result, Primary!, dw_grn, 1, Primary!)
result = dw_lhr.GetSelectedRow(0)
LOOP[/pre]

Matt



"Nature forges everything on the anvil of time"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top