如何在DataGrid视图中验证单元格中的十进制值 [英] how to validate decimal value in a a cell in datagrid view
本文介绍了如何在DataGrid视图中验证单元格中的十进制值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
.只允许按整数和.".
使用网格中的模板列
并定期进行如下操作
< asp:RegularExpressionValidator ID =" ="span> runat =" 服务器" ControlToValidate =" txtDecimal" ErrorMessage =" 文本 =" *" Val idationExpression =" 宽度 1像素" ">< /asp:RegularExpressionValidator >
>
hi i am using gridview in vb.net windows applications.in the grid view first two cells are string value and the 3rd cell we have to enter decimal values.please someone help me to validate like not allow to press follwing keys a-z[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$.and only allow to press integer and ".".
解决方案
.and only allow to press integer and ".".
use template column in grid
and have a regular experssion like below
<asp:RegularExpressionValidator ID="REVtxtDecimal" runat="server" ControlToValidate="txtDecimal" ErrorMessage="decimal Value-Enter only numerics.Format like (x.xx)" Text="*" ValidationExpression="^\d+(\.\d\d)?
" Width="1px"></asp:RegularExpressionValidator>
这篇关于如何在DataGrid视图中验证单元格中的十进制值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文