GridControl Custom Drag and Drop

I am new to this grid control and I'm working to create a custom D&D function. This grid will have "boxes" of data, and when I select the Header of one of these boxes, I should be able to drag and drop the box to another location on the grid. Currently i'm able to do this using the mouse events, but I would like to use the DragOver and DragDrop events so the user is aware he is dragging.

I currently have DragOver and DragDrop implemented, but when I drag the cell to another location I keep getting the "Not Allowed" cursor when I pause the mouse, when the mouse is in motion it shows the "Move" cursor.

The drag movement will not be the normal OLE move as this grid is refreshed off a custom data source. I receive this exception when I let go out the mouse during the drag. Perhaps a default D&D functionality of the grid is interfering with my custom events ? Any help is appreciated.

System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: rowIndex
at Syncfusion.Collections.SFTable.set_Item(Int32 rowIndex, Int32 colIndex, Object value)
at Syncfusion.Windows.Forms.Grid.GridRowCollection.set_Item(Int32 rowIndex, Int32 colIndex, GridStyleInfoStore value)
at Syncfusion.Windows.Forms.Grid.GridData.set_Item(Int32 rowIndex, Int32 colIndex, GridStyleInfoStore value)
at Syncfusion.Windows.Forms.Grid.GridModel.SetCellInfo(Int32 rowIndex, Int32 colIndex, GridStyleInfo style, StyleModifyType modifyType, Boolean dontRaiseSaveCellInfoEvent, Boolean copyReferenceOnly)
catched at Syncfusion.Windows.Forms.Grid.GridModel.SetCellInfo(Int32 rowIndex, Int32 colIndex, GridStyleInfo style, StyleModifyType modifyType, Boolean dontRaiseSaveCellInfoEvent, Boolean copyReferenceOnly) in :line 0


1 Reply

CI Christopher Issac Sunder K Syncfusion Team June 27, 2011 07:11 AM UTC

Hi Brandon,

Thank you for your interest in Syncfusion products.

I have implemented the Drag and Drop functionality within the grouped range (colored block). The saveCellInfo event is handled for saving the dropped items to data source. The formula cells in last 2 columns are applied. The grouped range has been defined from a range named ‘OverallRange’. GetCells() and SetCells() methods are used to get/set the targeted range styles.

Here is the sample:

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=GC_Grouping_DnD-2069406637.zip

Kindly let me know if you are facing the issue still.

Regards,
Christo.



Loader.
Up arrow icon