Hi. We recently upgraded our website from using Infragistics controls Version=9.1.20091.1015 to Version=11.1.20111.2064. On a given page we use the WebCurrencyEdit (several times), with the culture set so that negative numbers are shown as "-$n" instead of "($n)". Before the upgrade, users could paste negative values of either format and in both cases the value would properly be converted to a negative number in the "-$n" format. Since upgrading, a negative number pasted in the "($n)" format is converted to a positive number instead of a negative number in the other format (unless the culture is set to always display negative numbers in that format).
I tried the newer WebCurrencyEditor control and got the same behavior.
Unfortunately, our clients are adamant that the controls work the way they did previously.
Firstly, is there a reason this was changed so that pasting a negative number in either format wouldn't automatically translate to a negative number in the specified display format? Would you be willing to restore this behavior in future releases?
In the mean time, how would I change this myself? Unless I am mistaken, I think the two possible approaches would be to intercept the keystrokes in clientside scripts (looking for a "(" and replacing it with a "-"), or changing ig_edit.js for the control itself.
The latter seems cleanest... I think I see the the issue in the line:
me.isMinus=function(k){return k==this.minus.charCodeAt(0)||k == 45||(k==40&&this.negativePattern.indexOf('(')>=0)||k==12540||k==65293||k==65288;}
which maybe should be changed to:
me.isMinus=function(k){return k==this.minus.charCodeAt(0)||k == 45||k==40||k==12540||k==65293||k==65288;}
But if so, I am having trouble getting the site to see the modified version of the file. I presume it is using the now embedded version of the script. I have tried changing the web.config to use
<infragistics.web styleSetName="IFBlue" styleSetPath="~/ig_res" enableAppStyling="false" javaScriptDirectory="~/ig_common/20111CLR40/Scripts" />
When that didn't seem to have any effect, I tried changing the JavaScriptFileName property of the control directly:
<igtxt:webcurrencyedit id="Webcurrencyedit1" width="140" runat="server" HorizontalAlign="Right" JavaScriptFileName="~/ig_common/20111CLR40/Scripts/ig_edit.js"></igtxt:webcurrencyedit>
Still doesn't seem to be using the right version of the javascript.
Any ideas? Any help would be much appreciated!
Hi tinajanis,
This is an update to let you know that I am testing this issue. I will follow-up with you regarding the status of this support case on Friday.
To do this you can use this code snippet to set the culture so that negative currency values show as -$n as compared to the default representation for negative currency values in parenthesis ($n):
protected void Page_Load(object sender, EventArgs e)
{
System.Globalization.CultureInfo ci = System.Globalization.CultureInfo.CreateSpecificCulture("en-US");
ci.NumberFormat.CurrencyNegativePattern = 1;//"-$n";
this.WebCurrency1.Culture = ci;
}
Attached is a simple demo that shows this working with the WebCurrencyEditor.
Please let me know if you need any additional assistance regarding this matter.