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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Drag and Drop with the GridDataBoundGrid

Thread ID:





5467 Jul 3,2003 04:08 PM UTC Jul 8,2003 09:01 AM UTC WinForms 2
Tags: GridControl
Paul Laudeman
Asked On July 3, 2003 04:08 PM UTC

I'm trying to implement drag & drop functionality between the grid and another control (treeview) on my form. I'd like to catch the MouseDown event to detect which row the user clicked (via the x,y coords of the MouseEventArgs) and have select that entire row for the drag operation. I have implemented this before with the standard WinForms datagrid via the HitTestInfo but I'm not sure how to do it with the Syncfusion Grid. Thanks! -Paul

Administrator [Syncfusion]
Replied On July 3, 2003 08:50 PM UTC

Here is some general information and a couple of samples that might get you going. Essential Grid has an extensible OLE D&D architecture that you can tie into if you want. You would not have to handle things like DragEnter, DrawOver, etc. Instead, you create your own dataobject that implements IGridDataObjectConsumer, and register this object with RegisterDataObjectConsumer that tells the grid to check for your dataobject in its OLE D&D. Attached is a VB project that shows how you can create a dataobject to drag a row for a Windows Forms DataGrid to a GridControl. There are only 4 items you need to implement for the interface as you can see from the sample. Here is another sample with a class added that implements IGridDataObjectConsumer to provide drop support for a treenode. This implemetation justs automaticlly drops the node text as a new row to a GriddataBoundGrid (not quite what you want). 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. If you get stuck, post again.

Paul Laudeman
Replied On July 8, 2003 09:01 AM UTC

Thanks for your quick response. As it turns out, all I was missing was my event handler in code. Apparently VS.NET dropped the "handles" statement from my event handler when I deleted the winforms datagrid and replaced it with the Syncfusion grid.


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

Live Chat Icon For mobile
Live Chat Icon