The purpose of this blog is to show techniques involving SharePoint development which is a platform I'm really passionate about. Some of techniques will include InfoPath, Nintex, Flow, REST API, CSOM/JSOM, PowerBI, etc...
Thursday, November 27, 2014
Wednesday, January 8, 2014
Programmatically add a row to a repeating table using an XmlWriter object
- Add the following code to the Clicked event handler of the button:
C#string myNamespace = NamespaceManager.LookupNamespace("my");
using (XmlWriter writer = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:group1", NamespaceManager).AppendChild())
{writer.WriteStartElement("group2", myNamespace);writer.WriteElementString("field1", myNamespace, "Cell 1");writer.WriteElementString("field2", myNamespace, "Cell 2");writer.WriteElementString("field3", myNamespace, "Cell 3");writer.WriteEndElement();writer.Close();
}
Visual BasicDim myNamespace As String = NamespaceManager.LookupNamespace("my")
Using writer As XmlWriter = MainDataSource.CreateNavigator().SelectSingleNode( _"/my:myFields/my:group1", NamespaceManager).AppendChild()writer.WriteStartElement("group2", myNamespace)writer.WriteElementString("field1", myNamespace, "Cell 1")writer.WriteElementString("field2", myNamespace, "Cell 2")writer.WriteElementString("field3", myNamespace, "Cell 3")writer.WriteEndElement()writer.Close()
End Using - Save, build, and test your work.
Article taken from:
http://www.bizsupportonline.net/infopath2007/programmatically-add-row-repeating-table-xmlwriter.htm
Subscribe to:
Posts (Atom)