Solved

urgent!!!how can i move a row up and down in the same datawindow?

Posted on 2001-07-22
7
1,224 Views
Last Modified: 2013-12-26
pls help me !
i am so anxious to kown how i can move the row freely
in the same dw!
0
Comment
Question by:feckless
7 Comments
 
LVL 4

Expert Comment

by:Bhatti
Comment Utility
Hi Feckless,

Use the RowsMove() function to move the row.

dw_1.RowsMove(startrow, endrow, buffer!, targetdw, beforerow, targetbuffer)

dw_1.RowsMove(2, 2, Primary!, dw_1, 23, Primary!)

Use both time the same dw_name. start and end rows the row rows you want to move.
Target dw the datawindow where you wamt to move. and of course before which row you want to insert.
and buffer.

Try it, will help you.
0
 

Author Comment

by:feckless
Comment Utility
how can i drag the row up and dowm with a mouse
i don't know how to make the mouse in the status
of draging and droping
0
 

Expert Comment

by:Miguel_Angel
Comment Utility
Hi feckless:

I'm sure there is a more "professional" way to do this, but this is the "fast-nasty" way i do what you want to do (think so).

You need to declare a long instance variable to store the origin row, lets name it or_row.

In the datawindow events:

clicked
   or_row = row
   drag(begin!)

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

dragdrop
   rowsmove(or_row, or_row, primary!, this, row, primary!)

Remember to disable the option dragauto in the dw prorperties.

And that's all, of course, some error detection (like verify you clicked a row > 0 and you drop it in a row > 0) should help too. Note that rowsmove drops the row BEFORE the target.

Hope it helps!
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 4

Accepted Solution

by:
Bhatti earned 200 total points
Comment Utility
Hi Feckless,

Hier is solution. It is working.

Instance variable il_currentrow, il_row and il_checkrow

replace dw_1.with your own dw name

Dragdrop icon you can choose.

selectrow() function you can adjust with your own choice.

rest ist hier.

Please let me know if you have any question. I checked it is working 100%.

=============================================================
************************
clicked Event
************************

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

****************************
DragDrop Event
****************************

dw_1.drag(End!)
dw_1.RowsMove(il_row, il_row, Primary!, dw_1, row, 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.

*******************************
Dragwithin Event
*******************************

il_currentrow = row
il_currentrow++
if row > 10 then scrolltorow(il_currentrow)
selectrow(0, false)
selectrow(row, true)


****************************
Scrollvertical Event
****************************

string ls_lastrow

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

RETURN 0

**********************************
Dragwithin Event
**********************************

long ll_row

if row = 0 then selectrow(1, true)    
   if row > il_checkrow - 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

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

=======================================================
0
 
LVL 4

Expert Comment

by:Bhatti
Comment Utility
Hello,

I forget last time to write the extention in Dragwithin EVENT;

Please the last two lines changed with these lines to avoid the selection of all lines.

if dwo.name = 'datawindow' then
   Selectrow(0, false)
else
   selectrow(0, false)
   selectrow(row, true)
end if

Moreover, I wrote two time dragwithin Event but you need last one, it  is the right one.

0
 
LVL 4

Expert Comment

by:Bhatti
Comment Utility
Hello Feckless,

I am setting the complete script here, because it is now in two parts and I want to set these two parts in one part.

Instance variable il_currentrow, il_row and il_checkrow

=============================================================
************************
clicked Event
 ************************

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

****************************
 DragDrop Event
****************************

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
****************************

string ls_lastrow

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

RETURN 0

**********************************
Dragwithin Event
**********************************

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
=============================================================

I set the complete script here. It is working good.

Please let me know.

THANKS
0
 

Expert Comment

by:SpideyMod
Comment Utility
Force Accepted

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now