infopath后台代码为下拉列表框赋值

首先:Infopath是Microsoft   Office中用于制作电子表单的组件,其功能在Office   2007中得到了加强,可以很好的与SharePoint等其他微软服务器产品结合.
其次:通过Infopath的菜单 "工具 "--> "编程 "或者控件的属性,可以添加自定义代码,通过infopath菜单 "工具 "--> "选项 "--> "设计 "可以指定编程语言是C#或者VB
最后:可以通过Microsoft.Office.InfoPath   命名空间提供的托管代码对象模型成员创建   System.Xml.XPath   命名空间的   XPathNavigator   类的一个实例,来访问和操作表单模板数据源中的   XML   数据,示例如下:
//   Create   XPathNavigator   and   specify   XPath   for   nodes.
XPathNavigator   repeatingTableRow1   =   this.MainDataSource.CreateNavigator().SelectSingleNode( "/my:myFields/my:group1/my:group2[1] ",   NamespaceManager);

//   Select   nodes   in   specified   XPathNavigator.
CurrentView.SelectNodes(repeatingTableRow1);

//   Get   selected   nodes.
XPathNodeIterator   selectedNodes   =   CurrentView.GetSelectedNodes();
//   Display   the   count   of   selected   nodes.
MessageBox.Show(selectedNodes.Count.ToString());

原文地址:https://www.cnblogs.com/chenjq0717/p/1731186.html