【已解决】通过插件动态指定显示格式化字符串
金蝶云社区-华阳通用_叶
华阳通用_叶
0人赞赏了该文章 1,287次浏览 未经作者许可,禁止转载编辑于2016年07月13日 16:31:23

已解决


我在SDK找到显示格式化字符串是DisplayFormatString
通过上图的代码改变不了此属性值
业务场景:
单据中有一列费用率是4位百分比显示,针对不同单据类型,有时需要显示正常的小数,而不是百分比。

找到解决方法了:
base.AfterBindData(e);
DecimalFieldAppearance control_F_ZJ_JN_FYL = (DecimalFieldAppearance)this.View.GetControl("F_ZJ_JN_FYL").ControlAppearance;
control_F_ZJ_JN_FYL.DisplayFormatString = "P3";

DecimalFieldAppearance control_F_ZJ_MN_FYL = (DecimalFieldAppearance)this.View.GetControl("F_ZJ_MN_FYL").ControlAppearance;
control_F_ZJ_MN_FYL.DisplayFormatString = "P2";

DecimalFieldAppearance control_F_ZJ_HN_FYL = (DecimalFieldAppearance)this.View.GetControl("F_ZJ_HN_FYL").ControlAppearance;
control_F_ZJ_HN_FYL.DisplayFormatString = "P1";

this.View.UpdateView("F_ZJ_JN_FYL");
this.View.UpdateView("F_ZJ_MN_FYL");
this.View.UpdateView("F_ZJ_HN_FYL");