Dynamically populate a DropownList with managed code - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

Dynamically populate a DropownList with managed code

Last post 08-05-2009 05:15 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-31-2009 01:09 PM

    Dynamically populate a DropownList with managed code

    I have an InfoPath form with custom C# code, and a Sharepoint list. I have a dropdownlist in the InfoPath form that I want to populate with a certain field from the Sharepoint list (I want the InfoPath dropdownlist to contain this field's value from every item in the Sharepoint list. I can successfully get the list of values I need from Sharepoint in my managed code, but I do not see how I can get these values into the dropdownlist (either bind to the list, or add each item in the list one by one). I thought I could modify the XML of the dropdownlist to insert my items, but the XML only contains the first item in the dropdownlist:

     <my:RelatedRiskID xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2009-07-20T18:12:59">Option 1</my:RelatedRiskID>

    I feel like this should be possible, but I can't find any resources on how to do it. Thanks in advance for the help.

  • 08-05-2009 05:15 PM In reply to

    Re: Dynamically populate a DropownList with managed code

    Hi JWoah12,

    You don't need code to do that. Create a data connection (Tools->Data Connection) to retrieve data from the SharePoint list. Double click the dropdown in the view and choose to populate from the external data. You can even choose to have the display and value be different.

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