VFP 9 Manual Drag Drop

Posted on 2009-12-18
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?
Question by:formadmirer
    LVL 14

    Accepted Solution

    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

    in grid1.column1.text1 dragdrop event give command

    in container2 dragdrop event give command

    in container1 dragdrop event give command
    insert into table2 (FieldName) values (table1.FieldName)
    delete in table1

    Now make both containers transparent and without borders

    Author Comment

    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.
    LVL 14

    Expert Comment

    Let me know how it goes
    LVL 14

    Expert Comment

    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.

    Author Closing Comment

    This worked well for my needs. Thank you.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    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://msd…
    Digital marketing agencies have encountered both the opportunities and difficulties that emerge from working with a wide-ranging organizations.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    730 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

    15 Experts available now in Live!

    Get 1:1 Help Now