Hi,
please is there a way how to programatically (in Form Script) copy entire row on Primary IDO Collection, and create new row from that copy?
Thanks.
Hello,
I did a quick try for StfFormCopy and Paste (Results below)
You might need to move the index for the desired row and modify refresh to override after the copy.
Regards,
Kaz
Thank you for the hint. However, I’m still a beginner with working on a Grid in this project, so could I please ask for some clarification?
My goal is as follows: I have a List<> of data, and for each item in this list I need to create a new row in the Grid and modify some of the values in those rows. For simplicity of the example, I’m changing only one value in the new row by simply incrementing a number.
List<>
My code currently looks like this:
foreach(Index ind in indSYRP) { ThisForm.GenerateEvent("StdFormCopy"); ThisForm.GenerateEvent("StdFormPaste"); ThisForm.PrimaryIDOCollection.MoveCurrentIndexAndRefresh(ThisForm.PrimaryIDOCollection.GetNumEntries() - 1, false); ThisForm.PrimaryIDOCollection.CurrentItem.Properties["accountCode"].SetValuePlusModifyRefresh(a.ToString()); //ThisForm.PrimaryIDOCollection.Save(); a++; } //ThisForm.PrimaryIDOCollection.Refresh();
But when processing it, I get the following error:
Could you please advise me on what I’m doing wrong? Thanks.
hello,
Please try this code below.
Result
Note:
you can use move index only if you want to start in a specific row.
Upon issuing the new command, set current object property will target that current row and do the modify refresh to set the value (please always use the modify refresh to see the values right away on the front end). Thanks!