Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Movable Records in a Grid??
Message
 
To
16/07/2001 17:24:27
N. Lea
Nic Cross Enterprises
Valencia, California, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00531262
Message ID:
00531278
Views:
12
>I have a quick question, which is probably simple enough. My question, is there a way to move records to different orders in a grid? Much like if you were going to move files by dragging and dropping?
>
>For instance:
>
>1 TESTING 1
>2 TESTING 2
>3 TESTING 3
>4 TESTING 4
>5 TESTING 5
>
>If I wish to move #5 (TESTING 5) to the top of the grid - permanently in the table. So I would click and hold on the 5 record in the grid and place it above the #1 or on the #1. Thus the order would change to:
>
>1 TESTING 5
>2 TESTING 1
>3 TESTING 2
>4 TESTING 3
>5 TESTING 4
>
>And the next time I would come into the form, this would be the new order. Would this be possible?
>
>Thanks for any help!!

Anythings possible. :)

But seriously though, yes. Read up on using drag and drop in the programmers guide. Then you will have to get creative by adding drag and drop functionality to the textbox controls in the grid column(s). Basically, I would add another field to the table to be used exclusively for ordering. (NOT the Pkey and not visible in the grid) Then when you start a drag you need to remember the record you are dragging and set the order number with the order number of the record you are dropping it on, AND reset the rest of the record order numbers following that inserted record. Then simply refresh the form or grid and it will be persistant next time you open the table.

Don't forget to SET ORDER when using this table.

HTH
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California
Previous
Reply
Map
View

Click here to load this message in the networking platform