插件中填充单据体中下拉列表字段值不起作用?
金蝶云社区-quHongan
quHongan
0人赞赏了该文章 1,224次浏览 未经作者许可,禁止转载编辑于2015年07月15日 11:36:17

[code]public override void DataChanged(DataChangedEventArgs e)
{
if (e.Field.Key == "F_meg_ProjectID")
{
if (e.NewValue == null)
return;

string projectID = e.NewValue.ToString();

ComboFieldEditor receiveAddress = this.View.GetFieldEditor("F_meg_ReceiveAddress", e.Row) as ComboFieldEditor;

List enumItems = new List();

EnumItem item = new EnumItem();
LocaleValue caption = new LocaleValue("地址1");
item.Caption = caption;
item.Value = "0";
item.EnumId = "0";
enumItems.Add(item);

item = new EnumItem();
caption = new LocaleValue("地址2");
item.Caption = caption;
item.Value = "1";
item.EnumId = "1";
enumItems.Add(item);

receiveAddress.SetComboItems(enumItems);

this.View.UpdateView();
}
}[/code]我要向单据体中的下拉列表字段中填充数据项(item),使用SetComboItems填充,但下拉列表仍没有可选项,代码如上,什么原因?

补充:如果下拉列表字段放在单据头则正常。