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
AD
Administrator
Syncfusion Team
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.
SA
Satish
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.
>
>
AD
Administrator
Syncfusion Team
July 29, 2004 09:49 AM UTC
You can use grid.Selections.GetSelectedRows to return any selected rows.
SA
Satish
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.
AD
Administrator
Syncfusion Team
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
CG
Cyril George
April 25, 2012 02:30 PM UTC
Pathetic! Wake up Syncfusion... Fix your broken links pleeez!
RB
Ragamathulla B
Syncfusion Team
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.