Bug Report T282686
Visible to All Users

ASPxSpinEdit - Certain CurrencyNegativePattern formats are not supported

created 10 years ago (modified 10 years ago)

Hello,

I have a problem with the AspxSpinEdit control version 14.2.5.

In our application, we enable customers to define the display format for Currency fields. We have been using Thread.CurrentThread.CurrentCulture and setting these properties:
- NumberFormat.CurrencyDecimalDigits
- NumberFormat.CurrencyPositivePattern
- NumberFormat.CurrencyNegativePattern

This works fine unless NumberFormat.CurrencyNegativePattern has values of 5, 7, 11 and 13. Any of these values cause the following issue:

Currency values have the expected format when rendered for the first time. However, the currency field display becomes inconsistent as the field gets and then loses focus.

For example, if the field's value is "$ 12.5-", it becomes "-12.5" on focus, and "12.5" on losing focus. The original format is never restored.

After some research I found this piece of JavaScript code:
switch(__aspxCultureInfo.currNegPattern) {
     case 0:
      bag.push("(", __aspxCultureInfo.currency);
      break;
     case 1:
      bag.push("-", __aspxCultureInfo.currency);
      break;
     case 2:
      bag.push(__aspxCultureInfo.currency, "-");
      break;
     case 3:
      bag.push(__aspxCultureInfo.currency);
      break;
     case 5:
     case 8:
      bag.push("-");
      break;
     case 9:
      bag.push("-", __aspxCultureInfo.currency, " ");
      break;
     case 12:
      bag.push(__aspxCultureInfo.currency, " -");
      break;
     case 14:
      bag.push("(", __aspxCultureInfo.currency, " ");
      break;
     case 15:
      bag.push("(");
      break;
    }

switch(__aspxCultureInfo.currNegPattern) {
     case 0:
     case 14:
      bag.push(")");
      break;
     case 3:
      bag.push("-");
      break;
     case 5:
      bag.push(__aspxCultureInfo.currency);
      break;
     case 8:
      bag.push(" ", __aspxCultureInfo.currency);
      break;
     case 10:
      bag.push(" ", __aspxCultureInfo.currency, "-");
      break;
     case 15:
      bag.push(" ", __aspxCultureInfo.currency, ")");
      break;
    }
   }

As far as I can tell, formats 5, 7, 11 and 13 are not supported. If so, is there a reason for this?  Will you provide any advice or guidance on what we can do to have these formats in our application?

Regards,
Vladimir Vinogradsky

Comments (1)

    Hello Vladimir,

    Thank you for contacting us. I see the problem. I will forward this issue to our R&D team. Our developers will continue working on this problem, and we will keep you informed of any progress.

    Answers approved by DevExpress Support

    created 9 years ago

    We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

    Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.