Please help with Drag and Drop RRS feed

  • Question

  • This is my requirement.

    I am allowed to use a DGV (or a List View or some other control that can be used in tabular form).

    Then, I have a set of labels/text boxes that are created in runtime according to some data from a DB. Let's say just text tabels.

    So I need to drag and drop contents of these run time generated textboxes/labels onto any preferred cell in the DGV (or that any other control). When that is done, I need to be able to delete/destroy the original label as well.

    On the other hand, if the user decides to take some data from the DGV and put them back in the original labels, that should also be possible. SO I guess those labels/textboxes need to be put inside of some kind of a control.

    But I'm relatively new to C#, so haven't got much of an idea so as to how to do this. I could get text on labels to be copied to another lables, but when I used a DGV I got stuck.
    Main reason being, when an item is dragged onto the DGV, there seems to be no event to detect on which cell the mouse is. The Mouse_Enter method works only for simple mouse enter movements - not when dragging.

    • Moved by Michael Sun [MSFT]Microsoft employee Thursday, October 23, 2008 10:21 AM Off Topic for Visual C# General [loc] (Moved from Visual C# General to Off-Topic Posts (Do Not Post Here))
    Tuesday, October 21, 2008 7:22 AM


All replies