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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Copy & Paste of hierarchical nature of this data

Thread ID:

Created:

Updated:

Platform:

Replies:

17021 Jul 29,2004 08:38 AM UTC May 1,2012 04:56 AM UTC WinForms 7
loading
Tags: GridControl
Satish
Asked On July 29, 2004 08:38 AM UTC

Clay, I have parent & Child table. If user copies any only row(s) in the parent and paste, I would like to even paste the related child records for the selected row. Child datagrid (datatable) will be hidden........ How can we achieve this? NOTE : ONLY ROW(S) COPY NOT THE CELL COPY Thanks Satish

Administrator [Syncfusion]
Replied On July 29, 2004 09:14 AM UTC

There are two ways that I can think of to try to implement this. Both involve handling the grid.Model.ClipboardCopy event. The first technique would be in the ClipboardCopy handler to loop through the selections, and if a parent row is selected, expand the row and then add the child rows to the grid.Selections collection. Then the default copy should include the child rows. The second techinque is to handle the complete copy process in ClipboardCopy and not relying on the default copy at all. This would give you complete control and probably will be the better appraoch. Again you would loop through all the selected rows, putting the values into a tab delimited string (and delimiting the rows with a Environment.NewLine). When you got to a parent row, you would also loop through its children rows, adding them to the tab delimited string. Then you would put the string in to the Clipboard and setting both e.Handled and e.Result equal true.

Satish
Replied On July 29, 2004 09:39 AM UTC

Clay, Thanks but my problem is this should be executed only if the user is selected the whole row?? how can i check this? Thanks Satish >There are two ways that I can think of to try to implement this. Both involve handling the grid.Model.ClipboardCopy event. > >The first technique would be in the ClipboardCopy handler to loop through the selections, and if a parent row is selected, expand the row and then add the child rows to the grid.Selections collection. Then the default copy should include the child rows. > >The second techinque is to handle the complete copy process in ClipboardCopy and not relying on the default copy at all. This would give you complete control and probably will be the better appraoch. Again you would loop through all the selected rows, putting the values into a tab delimited string (and delimiting the rows with a Environment.NewLine). When you got to a parent row, you would also loop through its children rows, adding them to the tab delimited string. Then you would put the string in to the Clipboard and setting both e.Handled and e.Result equal true. > >

Administrator [Syncfusion]
Replied On July 29, 2004 09:49 AM UTC

You can use grid.Selections.GetSelectedRows to return any selected rows.

Satish
Replied On July 30, 2004 02:04 AM UTC

Clay, I am having problem while pasting becuase of paste content exceeds row''s count. So how to handle this? Do you have any sample? Thanks Satish >You can use grid.Selections.GetSelectedRows to return any selected rows.

Administrator [Syncfusion]
Replied On July 30, 2004 05:04 AM UTC

Here is a little sample that uses grid.Model.ClipboardPaste to make sure the DataTable datasource has enough rows before it lets the grid do its default paste. CopyAppenGDBG_7859.zip

Cyril George
Replied On April 25, 2012 02:30 PM UTC

Pathetic! Wake up Syncfusion... Fix your broken links pleeez!


Ragamathulla B [Syncfusion]
Replied On May 1, 2012 04:56 AM UTC

Hi Cyril,

Thank you for your update.

Due to server maintanance that files are moved from our server so please refer to the following browser sample path which illustrates the same.

{InstalledPath}\Syncfusion\EssentialStudio\{Version}\Windows\Grid.Windows\Samples\2.0\MS Excel-Style Features\Grid Copy-Paste Demo

Let me know if you have any further concerns.

Regards,
Ragamathullah B.


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.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon 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.Close Icon

;