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.
Unfortunately, activation email could not send to your email. Please try again.

Copy and Paste

Thread ID:

Created:

Updated:

Platform:

Replies:

77785 Nov 17,2008 11:24 AM Dec 15,2008 09:43 AM WPF 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On November 17, 2008 11:24 AM

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


Administrator [Syncfusion]
Replied On November 17, 2008 01:31 PM

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

Administrator [Syncfusion]
Replied On November 17, 2008 02:11 PM

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


Administrator [Syncfusion]
Replied On December 15, 2008 09:24 AM

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?


Administrator [Syncfusion]
Replied On December 15, 2008 09:43 AM

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);




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;