Trying to follow code to Programmatically select all items in a multiple-selection (multi-select) list box - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Trying to follow code to Programmatically select all items in a multiple-selection (multi-select) list box

Last post 02-22-2017 03:11 PM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-22-2017 08:40 AM

    Trying to follow code to Programmatically select all items in a multiple-selection (multi-select) list box

    This post seems to have what I am trying to do - http://www.bizsupportonline.net/infopath2007/programmatically-select-all-items-multi-select-list-box.htm But, I cannot make it work with my external data source. Data source called - kits_docs Entries - /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW Value - d:val4kitID Display - d:val4kitID I can't seem to map my fields to Sym's. FIGURED IT OUT AS SHOWN BELOW: On-Click: Dim kits As XPathNodeIterator = DataSources("kits_docs").CreateNavigator().Select( _ "//d:SharePointListItem_RW", NamespaceManager) Dim kit As XPathNavigator For Each kit In kits Dim number As String = kit.SelectSingleNode("d:val4kitID", NamespaceManager).Value AddItem(number) Next Public Sub: Public Sub AddItem(ByVal itemId As String) Dim DOM As XPathNavigator = MainDataSource.CreateNavigator() Dim group2 As XPathNavigator = DOM.SelectSingleNode("//my:group2", NamespaceManager) Dim KitList As XPathNavigator = DOM.SelectSingleNode("//my:group2/my:KitList", NamespaceManager) Dim newNode As XPathNavigator = KitList.Clone() newNode.SetValue(itemId) group2.AppendChild(newNode) End Sub
    Jeffrey J Vojtko
  • 02-22-2017 03:11 PM In reply to

    Re: Trying to follow code to Programmatically select all items in a multiple-selection (multi-select) list box

     Great, glad you got it figured out. Sorry if the forum ate your formatting - we are running on an older version of Community Server that seems to work best with Internet Explorer. :)

    Hilary Stoupa

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