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

contextmenustrip copy paste


I'm trying to implement a contextmenustrip that can cut, copy, and paste. I have the following code that creates the contextmenustrip for the databoundgrid.

databoundgrid.contextmenusstrip = this.contextmenustrip

How do I get the selected area from the grid and copy to the clipboard? Thanks!

1 Reply

HA haneefm Syncfusion Team July 20, 2007 09:05 PM UTC

Hi Coder12345,

You can achieve this using CutPaste.CopyTextToClipboard() method, which takes GridRangeInfoList as the argument. Below is the code snippet:

gridControl1.CutPaste.CopyTextToClipboard(gridControl1.Selections.Ranges); //For text
///gridControl1.CutPaste.CopyCellsToClipboard(gridControl1.Selections.Ranges,true); //For styles

Also you can do this by calling the CutPaste.Copy() method in a grid. It copies the selected ranges in a grid.

gridControl1.CutPaste.Copy();//

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon