Choice Group in Repeating Section - InfoPath Dev
in

InfoPath Dev

Choice Group in Repeating Section

Last post 09-23-2011 12:25 PM by bblanke. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-21-2011 09:22 AM

    • bblanke
    • Top 500 Contributor
      Male
    • Joined on 11-12-2009
    • Milwaukee, WI
    • Posts 32

    Choice Group in Repeating Section

    Repeating Section:
    /my:myFields/my:BackendProcesses/my:BackendFiles

    Choice Group:
    /my:myFields/my:BackendProcesses/my:BackendFiles/my:Conversions

    Choices:
    /my:myFields/my:BackendProcesses/my:BackendFiles/my:Conversions/my:Inkjet
    /my:myFields/my:BackendProcesses/my:BackendFiles/my:Conversions/my:VDP

    Fields I need:
    /my:myFields/my:BackendProcesses/my:BackendFiles/my:Conversions/my:Inkjet/my:IJConvName ==> Conversion Names
    /my:myFields/my:BackendProcesses/my:BackendFiles/my:Conversions/my:VDP/my:VDPConvName ==> Conversion Names
    /my:myFields/my:BackendProcesses/my:BackendFiles/my:File ==> input files

    I'm trying to use code (C#) to make a new table that contains 'Conversion Names' and 'Input Files'. One input file could be under multiple conversions.

    I'm not sure how to write the code to get the values from the choice groups.

    I think I need to do something like a foreach statement in a foreach statement. But I'm not sure how to handle the xpathnavigator and xpathnodeiterator statements to get all the values. I've been able to get the values in the choice groups for first node of conversions using a single foreach statement. And now I'm stuck and don't know how to get the other nodes.

    Can anyone send me some code to help figure this out?
    Brandon Blanke
    Technical Analyst / Quad Graphics
  • 09-23-2011 12:25 PM In reply to

    • bblanke
    • Top 500 Contributor
      Male
    • Joined on 11-12-2009
    • Milwaukee, WI
    • Posts 32

    Re: Choice Group in Repeating Section

    Solved:

    XPathNavigator rootMain = MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:BackendProcesses", NamespaceManager);

    XPathNodeIterator selectnodes = rootMain.Select("my:BackendFiles", NamespaceManager);

    foreach (XPathNavigator node in selectnodes)
    {
    XPathNavigator rootNode = node.CreateNavigator().SelectSingleNode("my:Conversions", NamespaceManager);
    XPathNodeIterator selectsubnodes = rootNode.Select("my:Inkjet/my:IJConvName", NamespaceManager);
    foreach (XPathNavigator subnode in selectsubnodes)
    {
    MessageBox.Show(subnode.InnerXml.ToString());
    }
    }
    Brandon Blanke
    Technical Analyst / Quad Graphics
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.