Thank you.
I followed your advice, but I had problem with one control text box that gets filled with System.Environment.UserName
I ended up with following code for my purpose
XPathNavigator firstElement = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group3/my:group4[1]", NamespaceManager);string userName = firstElement.SelectSingleNode("my:txtCreatedBy", NamespaceManager).Value; //had to add this because this would get written over when other user inserted new item
firstElement.InsertAfter(firstElement);
XPathNavigator newElement = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group3/my:group4[1]", NamespaceManager);newElement.SelectSingleNode("my:dtDate", NamespaceManager).SetValue("");
newElement.SelectSingleNode(
"my:ddlStatus", NamespaceManager).SetValue("Draft");newElement.SelectSingleNode("my:ddlUpdateType", NamespaceManager).SetValue("Update Report");
newElement.SelectSingleNode(
"my:ddlMonthOfMonthlyUpdate", NamespaceManager).SetValue("January 2010");newElement.SelectSingleNode("my:Update", NamespaceManager).SetValue("");
newElement.SelectSingleNode(
"my:txtComment", NamespaceManager).SetValue("");newElement.SelectSingleNode("my:txtMonthlySummary", NamespaceManager).SetValue("");
newElement.SelectSingleNode(
"my:txtAssessment", NamespaceManager).SetValue("");newElement.SelectSingleNode("my:txtAtt", NamespaceManager).SetValue("");newElement.SelectSingleNode("my:txtCreatedBy", NamespaceManager).SetValue(System.Environment.UserName);//this action was setting the user name of both new and orginial item to same user name
newElement.MoveToNext();//I move to next to return the original user name on previous node
newElement.SelectSingleNode(
"my:txtCreatedBy", NamespaceManager).SetValue(userName);
Why does only this one field txtCreatedBy gets written over for node prior to newly inserted one? rest of the fields are untouched.
Thank you again for all your help