[英]Dynamically populate an InfoPath DropownList with managed code
I have an InfoPath form with custom C# code, and a Sharepoint list. 我有一个带有自定义C#代码和Sharepoint列表的InfoPath表单。 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: 我在InfoPath表单中有一个下拉列表,我想用Sharepoint列表中的某个字段填充该列表(我希望InfoPath下拉列表包含Sharepoint列表中每个项目的此字段的值。我可以成功获取所需的值列表从我的托管代码中的Sharepoint中获取,但是我看不到如何将这些值添加到下拉列表中(绑定到列表,或者一个接一个地添加列表中的每个项目),我想我可以修改下拉列表的XML插入我的项目,但XML仅包含下拉列表中的第一项:
<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. 先谢谢您的帮助。
If you plan to populate your dropdown list with a SharePoint list then you need to 如果您打算用SharePoint列表填充下拉列表,则需要
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.