修改单据体的列标题
金蝶云社区-yufugen
yufugen
0人赞赏了该文章 2,301次浏览 未经作者许可,禁止转载编辑于2015年11月18日 10:05:15

[code]public override void OnSetLayoutInfo(SetLayoutInfoArgs e)
{
base.OnSetLayoutInfo(e);

// 创建当前单据元数据副本,避免直接修改原始元数据,并发时串账
FormMetadata currmetadata = (FormMetadata)ObjectUtils.CreateCopy(
this.View.OpenParameter.FormMetaData);
BusinessInfo _currBusinessInfo = currmetadata.BusinessInfo;
LayoutInfo _currLayoutInfo = currmetadata.GetLayoutInfo();

if (FCOUNTTYPE.ToString() == "LOSS")
{
//this.View.BusinessInfo.GetField("F_st_Qty").PropertyName = "盘亏数量";
_currLayoutInfo.GetAppearance("F_st_Qty").Caption = new LocaleValue("盘亏双数");
//this.View.LayoutInfo.GetAppearance("F_st_Qty").Caption = new LocaleValue("盘亏数量");
//this.View.LayoutInfo.GetAppearance("F_st_Qty").VisibleExt = "盘亏数量";
e.BillLayoutInfo = _currLayoutInfo;
}
else
{
//this.View.BusinessInfo.GetField("F_st_Qty").PropertyName = "盘盈数量";
_currLayoutInfo.GetAppearance("F_st_Qty").Caption = new LocaleValue("盘盈双数");
//this.View.LayoutInfo.GetAppearance("F_st_Qty").Caption = new LocaleValue("盘盈数量");
//this.View.LayoutInfo.GetAppearance("F_st_Qty").VisibleExt = "盘盈数量";
e.BillLayoutInfo = _currLayoutInfo;
}
}[/code]
如上代码段,用来动态修改单据体某列的标题,但修改不成功,不知道问题在哪里...