Cell Drag-and-Drop

Hi!

is it possible to drag-and-drop a cell value to another application (like Chrome URL field)? I dont want to neither a row nor an entire column but only the selected field.

And how drag this field if, when I clicked over it, Sfdatagrid seems to entry in "edit mode"?

I appreciate any help.


3 Replies

AR Arulpriya Ramalingam Syncfusion Team December 6, 2021 10:13 AM UTC

Hi David, 
 
Thank you for your interest in Syncfusion products. 
 
Currently, the SfDataGrid does not have support for dragging selected ranges within the grid or to an external application. To achieve this use case, we suggest that you to copy the content by invoking the ClipboardController.Copy() method when the cell is clicked by handling CurrentCellActivated event.  
 
Example code 
 
//To select current cell 
this.sfDataGrid1.SelectionUnit = Syncfusion.WinForms.DataGrid.Enums.SelectionUnit.Cell; 
//Event subscription 
this.sfDataGrid1.CurrentCellActivated += SfDataGrid1_CurrentCellActivated; 
 
//Event customization 
private void SfDataGrid1_CurrentCellActivated(object sender, CurrentCellActivatedEventArgs e) 
{ 
    sfDataGrid1.BeginInvoke(new Action(() => { sfDataGrid1.ClipboardController.Copy(); })); 
} 
 
We have attached a video demo and a sample to achieve your requirement and please make use of the same. 
 
 
Note: As we could not retrieve paste operation for external application (such as, chrome url search box), we suggest that you to paste the copied content manually. 
 
Please get back to us if you need any further assistance. 
 
Regards, 
Arulpriya Ramalingam 



DA DavidBS December 6, 2021 02:01 PM UTC

I appreciate yor help Arulpriya!

Have a good week.



AR Arulpriya Ramalingam Syncfusion Team December 7, 2021 06:50 AM UTC

Hi David, 
 
Thank you for the appreciation. 
 
Please get back to us if you have any other queries. 
 
Regards, 
Arulpriya Ramalingam 


Loader.
Up arrow icon