Drag and Drop from Datagridview in C#
Posted on 2008-06-10
I have an application with a treeview and a datagrid, both are databound.
The treeview lists orders and below each order lists the packages in each order. The orders can be schemed based on lanes the products are being shipped on.
By default the treeview shows order number, unschemed , product.
When clicking on the order number node the datagrid view shows all the products in that order.
I want to be able to right click on an order and click on "Add Scheme" then have the program query a database table for the lane numbers and add children to the order number node named "Lane 1", "Lane 2", etc... Then I would like to be able select the products I want to go down a certain lane, drag them onto that lane, and have the program automatically modifiy the product database to indicate the new lane. When the datagrid is refreshed those orders should now show up under their proper lane and not the unschemed node.
Getting the drag an drop to work from the datagridview to the treeview is where I am really lost. Although I would appreciate input on the other steps I am really in need of help on this one part.