Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Value in TextBox Bound to Nullable Object

Status
Not open for further replies.

eb24

Programmer
Dec 17, 2003
240
US
I am using C#2.0 in a Windows Application and trying to validate a TextBox on its Validating Event. What I am basically looking for is to see if the value entered is a decimcal. Looks to be working but when I delete the contents of the TextBox, i.e. no value in there, the cursor cannot leave the TextBox. I am assuming this occurs b/c it is bound to a business object of decimal? type.

Can anyone assist me to get around this annoying fact?
 
the few occasions i've done this type of thing i've done it by trapping the kry up event and then cheking for IsDigit() i think - that way they can only add numbers in the first place ...
 
I think, you need to set it so that it allows empty text while validating. Don't know how to do it but sounds like thats the case. It is not moving away from the textbox because it still thinks the text box is not valid (is empty).

Try looking at the Validator properties.

Hope this helps

Ch Saj
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top