【Spread for Web Forms】CurrencyCellType隐藏货币符
2008-07-11 11:29
267 查看
一开始用GeneralCellType能实现隐藏货币符($),同时格式化数字(###,###,##0),但是却失去了ErrorMessage的功能,不能判断可输入最大值最小值。
Dim dCell As New FarPoint.Web.Spread.GeneralCellType
Dim numFormat As New System.Globalization.NumberFormatInfo
numFormat.NumberDecimalDigits = 0
dCell.NumberFormat = numFormat
dCell.FormatString = "n"
参考以下方法
t=System.Threading.Thread.CurrentThread;
oldCulture=t.CurrentCulture;
System.Globalization.CultureInfo newci = (System.Globalization.CultureInfo)oldCulture.Clone();
newci.DateTimeFormat.DayNames=new string[]{"日","一","二","三","四","五","六"};
newci.DateTimeFormat.FirstDayOfWeek=DayOfWeek.Sunday;
t.CurrentCulture=newci;
作成以下解决方案
Private t As System.Threading.Thread
Private oldCulture As System.Globalization.CultureInfo
Private Sub FPspread1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles ssList.PreRender
t = System.Threading.Thread.CurrentThread
oldCulture = t.CurrentCulture
Dim newci As System.Globalization.CultureInfo = DirectCast(oldCulture.Clone(), System.Globalization.CultureInfo)
newci.NumberFormat.CurrencySymbol = ""
newci.NumberFormat.NumberDecimalDigits = 0
t.CurrentCulture = newci
End Sub
知识点:
System.Globalization 命名空间包含定义区域性相关信息的类,这些信息包括语言、国家/地区、使用的日历、日期、货币和数字的格式模式以及字符串的排序顺序。
Dim dCell As New FarPoint.Web.Spread.GeneralCellType
Dim numFormat As New System.Globalization.NumberFormatInfo
numFormat.NumberDecimalDigits = 0
dCell.NumberFormat = numFormat
dCell.FormatString = "n"
参考以下方法
t=System.Threading.Thread.CurrentThread;
oldCulture=t.CurrentCulture;
System.Globalization.CultureInfo newci = (System.Globalization.CultureInfo)oldCulture.Clone();
newci.DateTimeFormat.DayNames=new string[]{"日","一","二","三","四","五","六"};
newci.DateTimeFormat.FirstDayOfWeek=DayOfWeek.Sunday;
t.CurrentCulture=newci;
作成以下解决方案
Private t As System.Threading.Thread
Private oldCulture As System.Globalization.CultureInfo
Private Sub FPspread1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles ssList.PreRender
t = System.Threading.Thread.CurrentThread
oldCulture = t.CurrentCulture
Dim newci As System.Globalization.CultureInfo = DirectCast(oldCulture.Clone(), System.Globalization.CultureInfo)
newci.NumberFormat.CurrencySymbol = ""
newci.NumberFormat.NumberDecimalDigits = 0
t.CurrentCulture = newci
End Sub
知识点:
System.Globalization 命名空间包含定义区域性相关信息的类,这些信息包括语言、国家/地区、使用的日历、日期、货币和数字的格式模式以及字符串的排序顺序。
相关文章推荐
- 【Spread for Web Forms】关于隐藏列的问题
- 关于FP Spread for Web Forms 2.0.0.0
- 中国式会计凭证货币金额控件(FarPoint Spread Custom CellType版)
- Spread For Web Forms 3.0 依然无可匹敌
- Spread for Windows Forms高级主题(8)---通过暂停布局提高性能
- [收藏] Best Practices for Hints and Validation in Web Forms
- Spread for Windows Forms快速入门(1)---开始使用Spread
- Spread for Windows Forms快速入门(4)---常用的单元格类型(上)
- Spread for Windows Forms快速入门(5)---常用的单元格类型(下)
- Spread for Windows Forms快速入门(6)---定义单元格的外观
- Spread for Windows Forms快速入门(7)---单元格的交互操作
- Spread for Windows Forms快速入门(9)---使用公式
- Spread for Windows Forms快速入门(14)---文件操作
- Spread for Windows Forms高级主题(1)---底层模型
- Spread for Windows Forms高级主题(4)---自定义用户交互
- The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)
- 使用Spread Studio for .NET显示或隐藏工作表
- Essential Studio for ASP.NET Web Forms发布2017 v2,新增自定义树形网格工具栏等
- Spread 之自定义对角线cellType源码: DiagonalCellType
- TrueType core fonts for the Web EULA问题解决方案