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

Please help with CELL drag N drop to another CELL within same ggc.

All the examples that I have seen in this forum only show ROW drag and drop. I want to drag a value from one CELL to another CELL.

is it possible to do CELL drag and drop to another CELL with the target CELL highlighted?

Please provide an example!

3 Replies

AD Administrator Syncfusion Team September 26, 2006 11:25 AM UTC

Hi James,

The grouping grid currently has no support for the CELL drag and drop functionality. The work around to handle the TableControlMouseDown event and call the DoDrag method to enable the drag and drop functionality in a cell. The attached sample implements the cell drag and drop functionality and also highlights the cell when the mouse move over it.

Sample : http://www.syncfusion.com/Support/user/uploads/CellDragDrop_172dfc82.zip

Let us know if this serves your need.

Regards,
Haneef


JA jamesb September 26, 2006 05:02 PM UTC

I can work with this.

However, I noticed that clicking on any cell triggers the DragDrog event.

Is there a way to prevent this and only allow drag for true dragNdrop and not when the cell is click.

Also, hwo can I determine the source''s record, the source column index, and source row index.


AD Administrator Syncfusion Team March 27, 2007 12:38 PM UTC

To avoid the DragDrop on the click, you need to postpone the drag operation until you have moved a little distance away from the mousedown point. You can use TabelControlCurrentCellMoveMove to handle thie requirement. Here is the sample modified to do this.

http://www.syncfusion.com/Support/user/uploads/CellDragDrop_68060c65.zip

To get the record, you can use the style object (which is being obtained in the current code)

GridTableCellStyleInfo style = tableControl.PointToTableCellStyle(pt);
if(style.TableCellIdentity.DisplayElement != null)
{
Record rec = style.TableCellIdentity.DisplayElement.GetRecord();
if(rec != null)
{
object someFieldValue = rec.GetValue("SomeField");
}
}

Loader.
Live Chat Icon For mobile
Up arrow icon