Programmatically Insert a checkbox into a repeating table - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Programmatically Insert a checkbox into a repeating table

Last post 07-18-2012 05:48 PM by Aaroninau. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 07-18-2012 05:48 PM

    Programmatically Insert a checkbox into a repeating table

    Hi everyone, i have a repeating table which contains a checkbox. The structure is

    activitylogs(group)-> activityLog(repeating table)-> ongoing (checkbox)

    I want to dynamically insert new row and assign the checkbox a value according to another filed value.
    I managed to insert the checkbox, but every time I assigned a value to the check box, I got an error.
    The error message says

    System.InvalidOperationException
    Schema validation found non-data type errors.

    I googled around and applied the DeleteNil function but still no luck.
    In the infopath designer, the datatype of the check box is True/False (boolean), value is FALSE when cleared and TRUE when checked
    The above is my code

    XmlDocument doc = new XmlDocument();
    XmlNode group = doc.CreateElement("my:activityLog", NamespaceManager.LookupNamespace("my"));
    XmlNode field = doc.CreateElement("my:ongoing", NamespaceManager.LookupNamespace("my"));
    XmlNode node = group.AppendChild(field);
    node.InnerText = "TRUE";
    doc.AppendChild(group);
    XPathNavigator node2 = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:activityLogs", NamespaceManager);
    DeleteNil(node2);
    node2.AppendChild(doc.DocumentElement.CreateNavigator());


    Please help me out. Many Thanks!
Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.