我想将货币格式添加到 AspxPivotGrid 表中的数据行。 你可以看到下面的图片,它现在是如何显示的。所以我只想将货币格式显示到 3 个字段(ExtendedPrice、ExtendedCost、Profit)
这是我的 C# 代码:
if (i == 8 || i == 9 || i == 10 || i == 11)
{
DevExpress.Web.ASPxPivotGrid.PivotGridField newF = new DevExpress.Web.ASPxPivotGrid.PivotGridField(names[i], PivotArea.DataArea);
newF.ID = "field" + newF.FieldName;
//newF.ValueFormat.FormatType=
ASPxPivotGrid1.Fields.Add(newF);
}
最佳答案
根据这个文档 ( FormatInfo ) 我认为应该这样设置:
newF.ValueFormat.FormatType = FormatType.Numeric;
newF.ValueFormat.FormatString = "c2";
关于c# - 如何通过编程方式将货币格式添加到 AspxPivotGrid 中的数据行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41800684/