Create a new row by copying a existing one

Hello, Ver3.2.1.0. In GGC, I want to add a function "Create/Enter a new record/row by copying an existing row". In details, user click any cell in GGC to select a row, then click "New row by Copying" button, it will copy all columns'' data of selected row to the new row (the row with "*" header). This function is like "SQL Server''s Open table" copy/paste a row. Is there any built-in function or sample code? Thanks,

2 Replies

LM Lan Mo September 25, 2005 11:05 PM UTC

Hello, I''ve built a sample to create a new row by copying. Please see attached. Select a row first, then click "Copy" button, it will the selected row to a new row. The problem is I want to set the current record to the newly added row and put the cursor in the first cell. Any idea to do that? I am not sure if there are other better ways to do the same task. Thanks, Lan >Hello, >Ver3.2.1.0. >In GGC, I want to add a function "Create/Enter a new record/row by copying an existing row". >In details, user click any cell in GGC to select a row, then click "New row by Copying" button, it will copy all columns'' data of selected row to the new row (the row with "*" header). >This function is like "SQL Server''s Open table" copy/paste a row. >Is there any built-in function or sample code? >Thanks, > > > CopyPaste_6520.zip


AD Administrator Syncfusion Team September 26, 2005 10:13 AM UTC

Hi Lan, Please try this after you add the new row to the DataTable to see if that helps. dt.Rows.Add(rowNew); // Set the current record this.gridGroupingControl1.Table.Records[dt.Rows.Count-1].SetCurrent(); //Editmode this.gridGroupingControl1.Focus(); this.gridGroupingControl1.TableControl.CurrentCell.BeginEdit(); Here is forum thread that has a sample for copy/paste in GridGroupingControl. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=30745 Best regards, Jay N

Loader.
Up arrow icon