Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you drag and drop grid rows?
Message
From
20/10/2000 16:22:01
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00432251
Message ID:
00432300
Views:
30
Well, now I understand.

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.

>Drag and Drop - where you click on a row (probably on the far left), hold down the mouse, drag the row up two rows, and then drop the row in the new spot.
>
>>You can put code in the header click event to sort grid by column of that header. To sort you can use index command or use existing indexes.
>
>>I have no idea what you meant by drag&drop. What you going to drag? Where drop? How this impact the sorting? Can you describe you idea more?
>
>>>Client wants to be able to self sort a grid. Currently I present the grid in the order that rows were created. I keep a sequence number on the table that determines my original sort. But now the client wants the ability to change the order of the displayed rows. What are some good obtions for accomplishing this? Can you drag and drop rows in a grid?
>>>
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform