Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
public decimal quantity{get;set;}
textbox text="{Binding quantity}"
Posted
Updated 10-Dec-15 0:47am
v2
Comments
Sergey Alexandrovich Kryukov 10-Dec-15 11:02am    
Perhaps by not writing it to TextBox.Text in first place? :-)
Alternatively, if you really want to have a text box permanently bound to decimal data, you just need to realize that something like empty string is not valid data for a text box bound this way?
—SA

1 solution

Make quantity property as Nullable:
C#
public decimal? quantity {get;set;}
 
Share this answer
 
Comments
Member 12033805 11-Dec-15 0:22am    
Is there any way to that better?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900