Get entire dropdown list items into an array in InfoPath - InfoPath Dev
in

InfoPath Dev

Get entire dropdown list items into an array in InfoPath

Last post 05-17-2013 08:43 AM by Artois. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-17-2013 02:25 AM

    • Artois
    • Not Ranked
    • Joined on 05-17-2013
    • Posts 3

    Get entire dropdown list items into an array in InfoPath

    I have an InfoPath XSN form template with a dropdown list. This is bound at design time to a data source and populated with a list of names when the form is loaded. I would like to get hold of all of the names in this dropdown list into an array for processing elsewhere on that form. I have tried to get hold of a reference to the dropdown list as below (and similar variations); XPathNavigator myNav = this.MainDataSource.CreateNavigator(); object dd = myNav.Select("/dfs:myFields/dfs:queryFields/q:Site/@STitle", this.NamespaceManager).Current; But I'm only getting the current value and not able to get hold of the entire list. Any one able to help please?
  • 05-17-2013 02:32 AM In reply to

    • Artois
    • Not Ranked
    • Joined on 05-17-2013
    • Posts 3

    Re: Get entire dropdown list items into an array in InfoPath

    Sorry I'm not able to get any carriage returns in my post. Everything appears in the same line.
  • 05-17-2013 07:47 AM In reply to

    Re: Get entire dropdown list items into an array in InfoPath

     You need an XPathNodeIterator - http://msdn.microsoft.com/en-us/library/system.xml.xpath.xpathnodeiterator.aspx

    I think the forum is fussy about browsers when it comes to line breaks and so forth - what browser are you using?

    Hilary Stoupa

  • 05-17-2013 08:43 AM In reply to

    • Artois
    • Not Ranked
    • Joined on 05-17-2013
    • Posts 3

    Re: Get entire dropdown list items into an array in InfoPath

    I have tried to use XPathNodeIterator.  But for reasons I can figure out, the XPathNodeIterator object only able to provide the first two values in the list.  So in the interest of saving time, I had to make a query direct to the the database and looped through the dataset.   At least I know XPathNodeIterator was the right way to go.

    Thanks

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