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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:





60541 May 7,2007 08:32 PM UTC May 8,2007 01:04 PM UTC WinForms 2
Tags: GridControl
Greg Goodall
Asked On May 7, 2007 08:32 PM UTC

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 09:19 PM UTC

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,

Greg Goodall
Replied On May 8, 2007 01:04 PM UTC


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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon