Jose Bredariol
asked on
How to accept only numbers in VS2008 Datagridview cell for windows application ?
I'm using Visual Studio 2008 DatagridView.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Both answers works for me. Thanks
You could just use the RegularExpressionValidator with the proper regex string to allow numbers only. Try placing the following code within the <EditItemTemplate></EditIt emTemplate > for the field you want to control.
Check out http://regexlib.com/Search.aspx?k=numbers%20only for more regular expressions to use. This is where I got the one for allows numbers only. Good luck.
Check out http://regexlib.com/Search.aspx?k=numbers%20only for more regular expressions to use. This is where I got the one for allows numbers only. Good luck.
<asp:RegularExpressionValidator id="reNumbersOnly" runat="server" ControlToValidate="txtFieldToControl" ValidationExpression="^[+]?\d*$" Text="Numbers Only Please." />
ASKER
I'll try this too. Thanks
ASKER