this.dataGrid1.RowDragDropController.DragStart += RowDragDropController_DragStart;
private void RowDragDropController_DragStart(object sender, Syncfusion.UI.Xaml.Grid.GridRowDragStartEventArgs e)
{
} |
this.dataGrid2.RowDragDropController.Dropped += RowDragDropController_Dropped;
private void RowDragDropController_Dropped(object sender, Syncfusion.UI.Xaml.Grid.GridRowDroppedEventArgs e)
{
} |
public class RowDragDropControllerExt : GridRowDragDropController
{
protected override void ProcessOnDrop(DragEventArgs args, RowColumnIndex rowColumnIndex)
{
base.ProcessOnDrop(args, rowColumnIndex);
var dropPosition = args.GetPosition(this.DataGrid); // drop location dragged record.
var record = this.DataGrid.GetRecordAtRowIndex(rowColumnIndex.RowIndex); // Dropped record.
if (args.Data.GetDataPresent("SourceDataGrid"))
{
var sourceDataGrid = args.Data.GetData("SourceDataGrid") as SfDataGrid; // DataGrid that initated event.
}
}
} |
public class SfDataGridBehavior : Behavior<SfDataGrid>
{
protected override void OnAttached()
{
base.OnAttached();
this.AssociatedObject.RowDragDropController = new RowDragDropControllerExt();
}
} |