We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How do I perform a DragDrop operation from a DataGrid to a TreeViewAdv?

Thread ID:

Created:

Updated:

Platform:

Replies:

60541 May 7,2007 04:32 PM May 8,2007 09:04 AM Windows Forms 2
loading
Tags: GridControl
Greg Goodall
Asked On May 7, 2007 04:32 PM

Does anyone have an example of dragging from a DataGrid control to a TreeViewAdv control?

I know this may not be a simple answer, but a starting point would be appreciated. I can fill in details as I work on it.

The attachment show a DataGrid on the right and a TreeViewAdv on the left. I want to drag BoxNumber 0000043 from the DataGrid onto the TreeViewAdv so the box moves to another location, like from B02 to B05.

Thanks in advance

DragDrop from DataGrid to TreeViewAdv.zip

haneefm [Syncfusion]
Replied On May 7, 2007 05:19 PM

Hi Greg,

Here is minimal sample with a class added that implements IGridDataObjectConsumer to provide drop support for a treenode. This implemetatin just automaticlly drops the node text as a new row to a Grid.

The steps are
1) add the TreeNodeDataObjectConsumer class whcih implements IGridDataObjectConsumer to support dropping of TreeNode objects.
2) add a Form_Load to register a TreeNodeDataObjectConsumer object as a dataconsumer that the grid will poll as part of its D&D support.

Sample : D&DGridTreeView.zip

Best regards,
Haneef

Greg Goodall
Replied On May 8, 2007 09:04 AM

Haneef,

This works well going from a TreeView to a DatGrid but I'm need to go in the other direction. I need to drag from the DataGrid and drop onto the TreeView. Also, my TreeView will have two levels, 1)a parent and 2) multiple children. I only want to be able to drop onto a child node. When the drop happens I don't need to add a new node, I just need to know which node this being "dropped" on. When I have that information I will perform a query that reloads the DataGrid (I can do the re-load part). I just don't know how to capture which TreeView node is being targetted.

One last piece of info. The user will click on the RowHeader in the DataGrid and drag that. In fact there may be one or more rows clicked/dragged.

Thanks again

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;