Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you drag and drop grid rows?
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00432251
Message ID:
00432318
Views:
21
Do you know of any code examples? I have never done a drag and drop in a grid.

Brenda

>First of all, you will need additional field in the alias used by grid. This could be numeric field that will be used to order rows. Initial value of this field match to the recno() (record number) for each row. Alias should be indexed by that field. The implementation here is very depended on what you use as RecordSource of grid: cursor (result of SQL SELECT), view or table?

>Than you can organize drag&drop in grid. This is quite a bit of mess, because you will require to play a lot with grid properties and objects. I recommend you to build it manually handling MouseDown, MOuseMove and MouseUp events.

>Once you finished drag&drop part and know exactly which row where should be placed, just change numbers in the sorting field to re-order rows, than grid.refresh to show rows in new order.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform