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. Image for the cookie policy date

Drag''n''Drop: How can I understand target cell in virtual mode of GC?

Hello! I want to implement DnD to GridControl. Where can I get rowIndex and colIndex of target cell? Thanks.

5 Replies

AD Administrator Syncfusion Team September 15, 2005 11:52 AM UTC

Hi Andrew, GridControl has built-in drag and drop features. All you have to do is set AllowDrop to true to paste. When you wish to drag items from grid, select the cells and hover over borders of the selected region, you will notice a drag icon indicating ready to drag, just drag. By this you can drag and drop items. See if this helps. Refer the sample in program files\syncfusion\essential studio\3.2.1.0\Windows\Grid.Windows\samples\Quick Start\OleDragDrop Best regards, Stanley


AN Andrew September 15, 2005 01:20 PM UTC

Hi Stanley! Thank you. You''ve described the steps to drag cells from the grid. And the another question is - how can I DnD some object _into_ the cell of grid and especially how do I(and grid) know the row and the column of cell, this obect was dropped to?


AD Administrator Syncfusion Team September 15, 2005 03:57 PM UTC

Hi Andrew, You can just drop the dragged items into the grid, this is possible only if you set AllowDrop to true. To know where the changes are made use CellsChanged handler. Private Sub gridControl2_CellsChanged(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCellsChangedEventArgs) Console.WriteLine(e.Range.Top +" "+ e.Range.Left +" "+ e.Range.Bottom +" "+ e.Range.Right) End Sub Best regards, Stanley


AN Andrew September 15, 2005 08:36 PM UTC

>Hi Andrew, > >You can just drop the dragged items into the grid, this is possible only if you set AllowDrop to true. To know where the changes are made use CellsChanged handler. > > Private Sub gridControl2_CellsChanged(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridCellsChangedEventArgs) > Console.WriteLine(e.Range.Top +" "+ e.Range.Left +" "+ e.Range.Bottom +" "+ e.Range.Right) > End Sub > > >Best regards, >Stanley Thanks! But where can I get object that was drop to grid (by the way, I am using virtual mode)? Do I synchronize 2 handlers (DnD and OnCellChange)?


AD Administrator Syncfusion Team September 17, 2005 07:57 AM UTC

Hi Andrew, Refer this sample and let me know if you need more information. Best regards, Stanley

Loader.
Live Chat Icon For mobile
Up arrow icon