Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drag-and-drop within MSFlexGrid 1

Status
Not open for further replies.

McCoz

MIS
Nov 6, 2000
4
0
0
DE
Hi,

How can I drag-and-drop single cells in a flexgrid? I want to move the content of a cell to another cell by dragging-and-dropping.

Thanks,
Bo
 
Hi Bo

Unfortunately the FlexGrid is not the correct Active X Control to use for this purpose.

The FlexGrid control not only does not allow drag and drop but there is no other way for users to enter data in a FlexGrid control. To place data into the cells of a FlexGrid control, it is necessary to use code.

Is there any other way to achieve your objective without using drag-and-drop?
 
You can simulate Drag&Drop by using a label. When you mouse_down a cell you copy the content of the cell to the label. Then you drag the label around(label.drag 1). The problem is that when you let go(on the grid) the dragdrop event occurs and you have only the source(label) and the position within the grid at your disposal. So you have to calculate where you are.
Another solution is without dragging, but copy the data from the cell when you click it and paste the data when you click on another cell.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top