?
Solved

dragdrop row from dw_1 overwriting dw_2 row

Posted on 2003-02-24
2
Medium Priority
?
863 Views
Last Modified: 2013-12-26
I am trying to dragdrop a selected row from dw_1 into dw_2 by overwriting a highlighted row in dw_2.  Basically, user clicks a row in dw_1 and drags the mouse over to dw_2 and highlights a row in dw_2 and unclicks.  This would take the row value from dw_1 and overwrite the highlighted row value in dw_2 without inserting a new row.

Example:
dw_1        dw_2
one         one
two         two
three       three
four        four

User drags value three from dw_1 over to dw_2 and overwrites two:
dw_1        dw_2
one         one
two         three (used to be two)
three       three
four        four

Thanks for any guidance you may be able to provide.
0
Comment
Question by:the_balk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
Bhatti earned 308 total points
ID: 8011382
Hello the_balk,

The following script I set before a year for some in expert-exchange, but this script if some one want to scroll with the same datawindow.

If you will see it carefully, you can find your solution. Please look this script carefully and if you need further explaination let me know.



Instance variable il_currentrow, il_row and il_checkrow

=============================================================
************************
clicked Event of dw_1
************************

IF row > 0 then
   il_row = row
   selectRow(0, false)
   selectrow(row, true)
    this.Drag(Begin!)
end if

****************************
DragDrop Event dw_1
****************************

dw_1.drag(End!)


if il_row > row then dw_1.RowsMove(il_row, il_row, Primary!, dw_1, row , Primary!)
if il_row < row then dw_1.RowsMove(il_row, il_row, Primary!, dw_1, row + 1, Primary!)

selectrow(0, false)
selectrow(row, true)

//or you can adjust with selectrow(row - 1, true) and so on
//row you can adjust yourself where you want to paste.

*****************************************************
Scrollvertical Event may you not need but leaving it
*****************************************************

string ls_lastrow

ls_lastrow = dw_1.Object.Datawindow.LastRowOnPage
il_flag = integer(ls_lastrow)

RETURN 0

**********************************
Dragwithin Event dw_2
**********************************

long ll_row

st_1.Text = string(il_flag)
il_currentrow = row
if row = 0 then selectrow(1, true)    
if row > il_flag - 2 then
  il_currentrow++
  scrolltorow(il_currentrow)
  st_2.text = string(ll_row)
else
  if il_currentrow > 0 then
      il_currentrow = il_currentrow - 1
      scrolltorow(il_currentrow)
  end if
end if
if dwo.name = 'datawindow' then
  selectrow(0, false)
else
  selectrow(0, false)
  selectrow(row, true)
end if
=============================================================

Please let me know if success/failer results.

Best regards


Bhatti
0
 
LVL 1

Author Comment

by:the_balk
ID: 8011811
Thanks Bhatti!

I inserted your code and with a little tinkering and the addition of setitem code in the dragdrop event, it works perfectly.

Again, thank you for your time and help.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question