Drag And Drop

hi!

When i drag a row from a GDBG to the column header or to somewhere else inside the grid, the data in the row is gone!

how do i prevent this happen?

1 Reply

AD Administrator Syncfusion Team August 23, 2006 08:24 AM UTC

Hi Lim,

My apologies for the delay in response.

I have created a sample as per your specification. The sample illustrates the possiblity to Drag and Drop the row in a grid without loosing the data. Please refer to the attached sample and let me know if you are trying something different.

bool isDrop = false;
private void gridDataBoundGrid1_QueryContinueDrag(object sender, System.Windows.Forms.QueryContinueDragEventArgs e)
{
if( e.Action == DragAction.Drop )
{
e.Action = DragAction.Cancel;
this.gridDataBoundGrid1.Binder.BeginEdit();
for(int i = 1; i <= this.gridDataBoundGrid1.Model.ColCount ; i++)
this.gridDataBoundGrid1.Model[RowIndex,i].Text = this.gridDataBoundGrid1.Model[sRowIndex,i].Text;
this.gridDataBoundGrid1.Binder.EndEdit();
isDrop = false;
}
}

Here is a sample.
http://www.syncfusion.com/Support/user/uploads/DragDrop_3f9a100b.zip

Thanks,
Haneef

Loader.
Up arrow icon