Dynamically populate an InfoPath DropownList with managed code
Posted
by Jared
on Stack Overflow
See other posts from Stack Overflow
or by Jared
Published on 2009-07-31T19:51:29Z
Indexed on
2010/04/19
16:03 UTC
Read the original article
Hit count: 488
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.
- Jared
© Stack Overflow or respective owner