[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

VFP 9 Manual Drag Drop

Posted on 2009-12-18
5
Medium Priority
?
1,977 Views
Last Modified: 2012-05-08
Hello Experts.

I have two identical tables, each with a single column. One table is populated with data, the other is empty.

On a form I need to display two grids, one sourced from populated table, and the second with the empty table.

What I would like to do is drag and drop a value from a field in the first grid into the second grid, thereby populating table two with this new value.

I understand VFP9 will not handle this automatically, and that the code will have to be done manually.

This, however, is over my head. Can someone provide me with a sample?
Thx.
0
Comment
Question by:formadmirer
  • 3
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
tusharkanvinde earned 2000 total points
ID: 26085890
Create 2 containers. 1 covering the target grid (container1) and the 2nd covering the full form (container2). send both of them to the back.

in grid1.column1.text1 mousedown event give command
thisform.container2.ZOrder(0)
thisform.container1.ZOrder(0)
this.Drag

in grid1.column1.text1 dragdrop event give command
thisform.container2.ZOrder(1)
thisform.container1.ZOrder(1)

in container2 dragdrop event give command
thisform.container2.ZOrder(1)
thisform.container1.ZOrder(1)

in container1 dragdrop event give command
insert into table2 (FieldName) values (table1.FieldName)
delete in table1
thisform.grid1.refresh
thisform.grid2.refresh
thisform.container2.ZOrder(1)
thisform.container1.ZOrder(1)

Now make both containers transparent and without borders
0
 

Author Comment

by:formadmirer
ID: 26091602
I am hoping to get the time to attempt what you have suggested a little later today or tomorrow.

To be honest, I'm not that skilled in FP and was hoping for something a little easier, or something I could look at and understand.

I have never over-laid containers on top of grids (or any other control for that matter) before, but I am eager to give it a try and see what happens.
0
 
LVL 14

Expert Comment

by:tusharkanvinde
ID: 26091631
Let me know how it goes
0
 
LVL 14

Expert Comment

by:tusharkanvinde
ID: 26095340
for the container, just place a container, make its top and left as 0 and height and width as same as the height and width of the form. Then in the format menu, send it to the back

for the other container, make its top and left = top and left of the grid, similarly height and width.
0
 

Author Closing Comment

by:formadmirer
ID: 31667994
This worked well for my needs. Thank you.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
Will the future of mobile app development include the same trends as those most relevant today? Find out by checking out the 7 trends of the future.
Loops Section Overview
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month19 days, 15 hours left to enroll

873 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