Created
September 6, 2012 11:43
-
-
Save weipah/3655286 to your computer and use it in GitHub Desktop.
Auto-increment repeating table position in InfoPath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "my:Inhalte" --> Repeating table data | |
public void Projektinformationen_Changed(object sender, XmlEventArgs e) | |
{ | |
//e.Operation property is equal to XmlOperation.Insert or XmlOperation.Delete | |
XPathNavigator nav = MainDataSource.CreateNavigator(); | |
XPathNodeIterator iter = nav.Select("/my:meineFelder/my:Inhalte/my:Position", NamespaceManager); | |
int i = 1; | |
while (iter.MoveNext()) | |
{ | |
iter.Current.SetValue(i.ToString()); | |
i++; | |
} | |
i--; | |
nav.SelectSingleNode("/my:meineFelder/my:maxPos", NamespaceManager).SetValue(i.ToString()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment