populate a list box - InfoPath Dev
in

InfoPath Dev

populate a list box

Last post 07-01-2008 07:37 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-01-2008 04:32 AM

    populate a list box

    Hi,

    ive read many articles about populating a list box through code and this is what ive got till now

     

    XPathNavigator DOM = this.MainDataSource.CreateNavigator();

     

    XPathNavigator group1 = DOM.SelectSingleNode("/dfs:myFields/my:userlist");

    XPathNavigator field1 = DOM.SelectSingleNode("/dfs:myFields/my:userlist/my:listname");

    XPathNavigator newNode = field1.Clone();

    newNode.SelectSingleNode("value").SetValue(thisXDocument.DOM.selectSingleNode("/dfs:myFields/my:unbound/my:textbox").text);

    newNode.SelectSingleNode("displayname").SetValue(thisXDocument.DOM.selectSingleNode("/dfs:myFields/my:unbound/my:textbox").text);

    group1.AppendChild(newNode);

     well, all this is okay but the first line gives me an error

    XPathNavigator DOM = this.MainDataSource.CreateNavigator();

     

    the current object has no member called MainDataSource. please help.

    ps: ive made that group with a repeating element etc. its only this first line thats a problem

     

  • 07-01-2008 07:37 AM In reply to

    Hi -- you don't need the "this" in your first line -- the syntax would be XPathNavigator DOM = MainDataSource.CreateNavigator();

    Hilary Stoupa

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