AD
Administrator
Syncfusion Team
November 17, 2005 10:29 AM UTC
There is no general support for copy/paste in the GridGroupingControl yet.
Copying and pasting data into a GridGroupingControl with parent-child relations is not straight forward. Here are some of the problems you will have to code through. What happens to primary keys that cannot appear twice in teh same table? What happens when you paste a record into a table with values that do not conform with the parent child constraint?
So, if you want to code this support, you can catch the Copy by subscribing to the Model.ClipboardCopy event for each TableControl in your nested data.
this.gridGroupingControl1.GetTableControl("ParentTable").Model.ClipboardCopy += new GridCutPasteEventHandler(Model_ClipboardCopy);
this.gridGroupingControl1.GetTableControl("ChildTable").Model.ClipboardCopy += new GridCutPasteEventHandler(Model_ClipboardCopy);
this.gridGroupingControl1.GetTableControl("GrandChildTable").Model.ClipboardCopy += new GridCutPasteEventHandler(Model_ClipboardCopy);
There, you can get the Table.SelectedRecords for each of your tables and put them on the Clipboard. To handle the paste, you would do something similar using the Model.ClipboardPaste event. (But you would have to enforce the constraint impose by your datasource at this point).