Iterate and Set Values in MultiSelect List box - InfoPath Dev
in

InfoPath Dev

Iterate and Set Values in MultiSelect List box

Last post 01-03-2012 01:01 PM by Anson Hidajat. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-03-2012 10:40 AM

    Iterate and Set Values in MultiSelect List box

     Good day and happy new year.

    I want to iterate through a multiselect list box and set the values of each of the items in the box to "True" (or whatever).

    The multiselect xpath =  "/my:myFields/my:secOptAnesth1/my:mLstMonitors_1"

     I tried the following to try and iterate through the list box:

              Dim myListBox As XPathNavigator = _
       CreateNavigator().SelectSingleNode("/my:myFields/my:secOptAnesth1/my:mLstMonitors_1", NamespaceManager)

                ' Select nodes in specified XPathNavigator.
                CurrentView.SelectNodes(myListBox)

                ' Get selected nodes.
                Dim selectedNodes As XPathNodeIterator = CurrentView.GetSelectedNodes()

                ' Display the count of selected nodes.
                MessageBox.Show(selectedNodes.Count.ToString())

                ' Loop through collection and display information.
                Dim selectedNode As XPathNavigator
                For Each selectedNode In selectedNodes
                    MessageBox.Show(selectedNode.Name)
                    MessageBox.Show(selectedNode.InnerXml)
                    MessageBox.Show(selectedNode.Value)
                Next

     ..but that did not work.

    So obviously I am missing some way to grab and set the values of each item.

    Thanks in advance for any help.

    Thanks.

     

  • 01-03-2012 01:01 PM In reply to

    Re: Iterate and Set Values in MultiSelect List box

    Anson Hidajat
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.