Hello,
Thanks for the new copy/paste in grid!
I would like to add a context menu to my grid with an option to copy selected cells to clipboard. How do I programmatically copy the selected cells in Infragistics grid to the clipboard?
What method should I call?
Regards,
Currently the easiest way to accomplish this is to create a class that inherits from the XamGrid. Then, create copy and paste methods which in turn call base.CopyToClipboard() and base.PasteFromClipboard(). You would then use the custom grid in your project and call the new methods from the click event of the ContextMenuItem. I've attached a small sample that demonstrates this approach though I use a button rather than a context menu to call the copy operation.
The reason this is needed is that the methods are marked as protected rather than being marked as public. We'll be exposing these methods publicly in the future.
Hello Jason,
Thanks! I was not sure this was a recommended way to do this.
Julien Benoit
Hello Julien,
The methods are now exposed as public in the latest service release for 2010 Vol. 3. Please let me know if you have any further questions or concerns about this matter.
Thank you.
I will load SR and try this functionality.
Victor
Hi Victor,
In the latest SR we made the methods public. So make sure you get the latest.
Also, we did do some performance improvements, which should improve the speed from what you're seeing with the release version.
-SteveZ
Hi,
I am using 10.3 and still see these methods as protected.
I am trying to copy and paste large chunks of data (entire columns or multiple rows on 60K records with 100 columns grid). It is very slow or gives me Out of Memory error.
However, initial pasting of the same data is very good - about five seconds.
Can you give me any recomendations how to improve speed?
Thanks.