问题描述
我有一个 Telerik 网格,它在页面加载时最初是空的,提交表单后,该表单中的值会添加到网格中。
但是当我添加新行时,我的货币格式不起作用。
这是我的网格中列之一的定义。
columns.Bound(m => m.PrincipalInvestAmount)
.Format("{0:c}")
.HtmlAttributes(new { style = "text-align:right" })
.ClientFooterTemplate("<div style='text-align: right'>#= GetRoundedCurrencyFooter('SplitTaxLotGrid','PrincipalInvestAmount') #</div>");
然后当我提交表单时,我通过 javascript 在网格中添加一行
var newRow = {
PrincipalInvestAmount: 15
};
var grid = $('#SplitTaxLotGrid').data("kendoGrid");
grid.dataSource.add(newRow);
然后添加该行,但该值未格式化为货币。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)