[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
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填充,但下拉列表仍没有可选项,代码如上,什么原因?
补充:如果下拉列表字段放在单据头则正常。
推荐阅读