Component EditMask 运用中的Bug分析
来源:互联网 发布:淘宝的详情页在那设置 编辑:程序博客网 时间:2024/06/15 17:12
最近在项目中用到组件的EditMask属性,但应用中觉得有些不尽人意。在网上搜了一些资料,发现在单纯Textbox中应用这个属性是没问题的,但在GridView网格中应用出现问题,没能按照计划完成功能。
Component EditMask 属性如下:
Placeholder
Description
#
Digit placeholder permits a numeric character or a plus or minus sign in this position (entry optional).
.
Decimal placeholder. The actual character used is the one specified as the decimal placeholder in your international settings. This character is treated as a literal for masking purposes.
,
Thousands separator. The actual character used is the one specified as the thousands separator in your international settings. This character is treated as a literal for masking purposes.
:
Time separator. The actual character used is the one specified as the time separator in your international settings. This character is treated as a literal for masking purposes.
/
Date separator. The actual character used is the one specified as the date separator in your international settings. This character is treated as a literal for masking purposes.
/
Treat the next character in the mask string as a literal. This allows you to include the #, &, A, … characters in the mask. This character is treated as a literal for masking purposes.
&
Character placeholder (entry required). Any character is permitted.
>
Convert all the characters that follow to uppercase.
<
Convert all the characters that follow to lowercase.
~
Turns off the previous < or >.
!
Causes the optional characters that follow in the edit mask to display from right to left, rather than from left to right. So, blanks appear on the left.
^
Turns off the previous ! character. After ^, blanks appear on the right.
A
Alphanumeric character placeholder (entry required). For example: a – z, A – Z, or 0 – 9.
a
Alphanumeric character placeholder (entry optional).
0
Digit placeholder (entry required). For example: 0 – 9.
9
Digit placeholder (entry optional).
C
Character or space placeholder (entry optional). Any character is permitted.
L
Letter placeholder (entry required). For example: a – z or A – Z.
?
Letter placeholder (entry optional).
/n
New line literal. It is applicable when Multiline property is set to True.
"
All characters in a string enclosed in double quotes are considered as literals.
Literal
All other symbols are displayed as literals; that is, as themselves.
EditMask最大的作用在于可以控制输入格式,以此代替校验。在GridView中应用此属性,限制网格只能输入Decimal类型,如想要控制为Decimal(8,2),则应该设置为“######.##”.但调试错误结果却为“1 4.05”是可以校验通过的,这就失去了EditMask属性的作用。因为未能自动清空空格,且如输入“102.05”后,再次编辑网格,会出现小数点后两位自动前提的情况,即“10205.”。就是说在Gridview中应用EditMask属性是无法校验Decimal类型参数的。但这一点在普通Textbox中是应用正常的,已得到验证。
因此,项目中只能改为输入参数后弹出消息校验,增加了开发工作量。在此记录下个人的开发心得,希望有机会看到Component EditMask 源码,并完善此Bug。
- Component EditMask 运用中的Bug分析
- 运用APICloud学习中的bug笔记
- GPS在物流配送中的运用分析
- 分析PureMVC中的观察者模式运用
- UML在概念模型中的运用分析
- 【Component】关于Ionic中的Component
- ExtJS Component分析
- 知识产权保护案例分析----CodeMeter在刺绣机行业中的运用
- 分析会计选择在税收筹划中的运用
- 定量分析与print跟踪在代码分析中的运用
- ColdFusion中的RecordSet Component
- bug分析
- MaskEdit的EditMask使用方法
- MaskEdit的EditMask使用方法
- delphi 的EditMask使用方法
- delphi 的EditMask使用方法
- delphi 的EditMask使用方法
- Spring中注解分析@component
- gcc生成静态库和动态库
- MSDN-SQL小摘抄[积累更新中...]
- Linux dhcp client 如何向dhcp server说明自己希望使用的主机名
- select 控件编辑 动态生成 下拉列表框
- AIX 5.3下创建逻辑卷、添加文件系统并挂载
- Component EditMask 运用中的Bug分析
- Tomcat在处理GET和POST请求时产生的乱码问题
- .NET Compact Framework 1.0 下实现hbitmap,以及用hbitmap创建hdc(c#)
- 图片加水印
- 载波侦听多路访问/冲突避免(CSMA/CD)协议
- ASP.NET的错误处理机制
- ZLG7290(wince下)驱动之不停执行同一动作的解决办法(作者:wogoyixikexie@gliet)
- linux 高级路由及流量控制总结
- 如何进行类设计