﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » Having trouble with Mask and text field with decimal numbers</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Sat, 06 Jun 2026 17:42:56 GMT</lastBuildDate><ttl>20</ttl><item><title>Having trouble with Mask and text field with decimal numbers</title><link>http://forum.strataframe.net/FindPost9330.aspx</link><description>I have field that the user needs to enter State tax. i.e. 7.0 or 7.2 or 10.1&lt;br&gt;
&lt;br&gt;
At first I had created the field in DDT as decimal with precision of 2.&lt;br&gt;
Then when I binded that field to a textbox, it would not even work properly or accept the "." prperly&lt;br&gt;
I tried with Mask TextBox and could not enter 07.12&lt;br&gt;
&lt;br&gt;
Then I changed the DDT to SmallMoney, rebuilt the database and rebuilt my BO.&lt;br&gt;
Tried it again, and I can't get to accept decimal numbers in either text box.&lt;br&gt;
&lt;br&gt;
Question:&lt;br&gt;
a) is it the field type I'm using in DDT, is wrong?&lt;br&gt;
b) Or what should I set on the mask to get it to work?&lt;br&gt;
&lt;br&gt;
Thanks!</description><pubDate>Wed, 06 Jun 2007 11:19:56 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: Having trouble with Mask and text field with decimal numbers</title><link>http://forum.strataframe.net/FindPost9368.aspx</link><description>[quote][b]Ben Chase (06/06/2007)[/b][hr]These are your possible values for the formatting:&lt;br&gt;
&lt;br&gt;
&lt;A href="http://msdn2.microsoft.com/en-us/library/system.globalization.numberformatinfo(VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.globalization.numberformatinfo(VS.80).aspx&lt;/A&gt;&lt;br&gt;
&lt;br&gt;
Also, on the MaskedTextBox, you might have to tell it to include the literals in the value. It's a property on the control, and I think it's set to exclude the literals by default.[/quote]&lt;br&gt;
&lt;br&gt;
Thank you Sir!</description><pubDate>Wed, 06 Jun 2007 11:19:56 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: Having trouble with Mask and text field with decimal numbers</title><link>http://forum.strataframe.net/FindPost9365.aspx</link><description>These are your possible values for the formatting:&lt;/P&gt;&lt;P&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/system.globalization.numberformatinfo(VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.globalization.numberformatinfo(VS.80).aspx&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also, on the MaskedTextBox, you might have to tell it to include the literals in the value.&amp;nbsp; It's a property on the control, and I think it's set to exclude the literals by default.</description><pubDate>Wed, 06 Jun 2007 11:01:27 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Having trouble with Mask and text field with decimal numbers</title><link>http://forum.strataframe.net/FindPost9361.aspx</link><description>Ok Mr. Ben, tested more with the obvious stuff first:&lt;br&gt;
&lt;br&gt;
a) Used the "N2" in the binding format of text box and solved the problem. However, in maskedtextbox, if you have set masked "99.99", it still goes crazy.&lt;br&gt;
&lt;br&gt;
without further looking, I'd say it needs "BindingFormat" value.&lt;br&gt;
Can you tell us the values that can be used in this field?&lt;br&gt;
&lt;br&gt;
Thanks!</description><pubDate>Wed, 06 Jun 2007 10:12:27 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: Having trouble with Mask and text field with decimal numbers</title><link>http://forum.strataframe.net/FindPost9356.aspx</link><description>Ben, before answering your questions, are you the questions related to TextBox or MaskedTextBox?&lt;br&gt;
Each one behaves differently when the are binded to BO. If I remove the binding, the controls work fine.&lt;br&gt;
&lt;br&gt;
There seem to be a problem, when I hit the decimal point "."&lt;br&gt;
After that it acts weird.&lt;br&gt;
&lt;br&gt;
Ben, I'm not trying not to follow/answer your questions, but I think you'll get a better experience and feedback if you try it yourself with a simple decimal field. It's very hard to describe and give you definite answers, depending on which textbox and when you enter the decimal point.&lt;br&gt;
&lt;br&gt;
Try it and if you still can't see it, I then will start...&lt;br&gt;
&lt;br&gt;
Thank you Sir!</description><pubDate>Wed, 06 Jun 2007 09:43:42 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item><item><title>RE: Having trouble with Mask and text field with decimal numbers</title><link>http://forum.strataframe.net/FindPost9351.aspx</link><description>Both of those data types should be returned as System.Decimal.&amp;nbsp; So, my first question is: if you put a break point in the 'set' of the property, do you hit the break point when you try to enter a value in the textbox?&amp;nbsp; Question 2: does it work if you set the BindingFormat to "N2" (without the quotes ;))?&amp;nbsp; Question 3: is it setting the value and just not saving off the decimal or is it not setting the value at all?&amp;nbsp; Question 4: if you're reaching the breakpoint on the set, is the value correct (does it have the proper decimal value) or it is a truncated decimal (like 7 instead of 7.2)?</description><pubDate>Wed, 06 Jun 2007 09:13:12 GMT</pubDate><dc:creator>StrataFrame Team</dc:creator></item><item><title>RE: Having trouble with Mask and text field with decimal numbers</title><link>http://forum.strataframe.net/FindPost9342.aspx</link><description>^Pump^</description><pubDate>Tue, 05 Jun 2007 20:36:49 GMT</pubDate><dc:creator>Ben Hayat</dc:creator></item></channel></rss>