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
close icon

Copy and Paste

Is there any copy and paste code built into the Syncfusion grid? I can see that it can copy individual cells when the contents are highlighted, but are there properties on the grid that you can use to get the contents of selected row(s) if someone selects some rows and tries to copy? Is there a built in copy and/or paste event as well?

Thanks


4 Replies

AD Administrator Syncfusion Team November 17, 2008 06:31 PM UTC

Our current code does not have direct support for Copy/Paste. We will be adding it to our library.

For now, you can get such support using events. Here is a sample that has a helper class that will allow you to support basic copy/paste functionality in the WPF GridControl.



CopyPasteExample_e78490cc.zip


AD Administrator Syncfusion Team November 17, 2008 07:11 PM UTC

Thanks, I will take a look at it.

>Our current code does not have direct support for Copy/Paste. We will be adding it to our library.

For now, you can get such support using events. Here is a sample that has a helper class that will allow you to support basic copy/paste functionality in the WPF GridControl.



CopyPasteExample_e78490cc.zip



AD Administrator Syncfusion Team December 15, 2008 02:24 PM UTC

When you click on the top of a column, or the very left side of a row, it highlights that whole column or row. Can you copy that entire row after highlighting that? I have tried it, but it gets stuck in a long process. It appears as though if you click on a column top and hit ctrl C, it copies forever. I broke in at row 42367. Is there a property that gets it to just copy the existing rows?



AD Administrator Syncfusion Team December 15, 2008 02:43 PM UTC

The ranges you get when you click a row header oe a column header are row ranges and columns ranges, both or which have an undertermined dimension. For example, in a column range, the range has no idea of how many rows there are, it only has knowledge of the specific column.

There is a GridRangeInfo method that can be used to handle such an issue. This method can take a row range or column range and convert it into a valid cell range (which will have exact information on both dimensions). So, you can use code like this to make sure a range will always be a vaild cell range.

//turn range froma row/column range to a cell range.
range = range.ExpandRange(1, 1, grid.Model.RowCount, grid.Model.ColumnCount);




Loader.
Live Chat Icon For mobile
Up arrow icon