本地化ASPXPivotGrid控件
时间:2011-02-17 来源:Maxwell Hu
1.首先继承一个PivotGridLocalizer 或ASPxPivotGridResLocalizer的子类,并覆盖GetLocalizedString方法.
2.在PrivotGrid初始化之前把这个继承的类赋给PivotGridLocalizer 的Active属性.
代码类似如下:
using System;using System.Web.UI;
using DevExpress.Data.PivotGrid;
using DevExpress.Web.ASPxPivotGrid;
using DevExpress.XtraPivotGrid.Localization;
public partial class _Default : System.Web.UI.Page
{
class CustomLocalizer : ASPxPivotGridResLocalizer
{
public override string GetLocalizedString(PivotGridStringId stringId)
{
switch (stringId)
{
case PivotGridStringId.GrandTotal:
return "全部";
case PivotGridStringId.TotalFormat:
return "{0} 全部";
default:
return base.GetLocalizedString(stringId);
}
}
}
public _Default()
{
PivotGridLocalizer.Active = new CustomLocalizer();
}
protected void Page_Load(object sender, EventArgs e)
{
}
}
相关阅读 更多 +