0
votes

I have two windows and each have one data window. I just want to double click on first window's data window to get the second window's data window and want to add the selected row from the second window's data window to the same fields of first. How can I make it possible?

2

2 Answers

1
votes
//On duoble click of window 1 datawindow
long ll_row
Window2 lw_win
//get selected row on other window 2
ll_row = lw_win.dw_2.getselectedrow(0)
IF ll_row > 0 THEN
    dw_2.RowsCopy(ll_row, ll_row, Primary!, dw_1, dw_1.rowcount()+1, Primary!)
END IF
0
votes

Many assumptions are being made but in a nutshell:

//in the doubleclick event on window1.dw_1
long ll_row, ll_newrow
//get selected row on other window
ll_row = window2.dw_2.getselectedrow(0)
IF ll_row > 0 THEN
   ll_newrow = dw_1.insertrow(0)
   dw_1.setitem(ll_newrow, 'colname1', window2.dw_2.getitemnumber(ll_row, 'colname1')
   dw_1.setitem(ll_newrow, 'colname2', window2.dw_2.getitemstring(ll_row, 'colname2')
   // and so on
END IF

There are many other ways to achieve the same thing based on what you are trying to do after you have copied the row from one place to another.