How to change currency symbol?

4 posts, 1 answers
  1. Ian
    Ian avatar
    51 posts
    Member since:
    Apr 2009

    Posted 26 May 2009 Link to this post

    I want to change the currency symbol displayed dependent on user selection.

    There is a property CurrencySymbol but this value appears to be ignored when rendering the UI. For instance even though I set it (and the value is displayed correctly when debugging and later retrieving it) using the following code the control always displays a £ sign:

     

    var ud = (RadNumericUpDown) this.CalculatorInputsGrid.FindName("LumpSumToInvestUpDown");

     

     

     

    if (ud != null)

     

    {

        ud.NumberFormatInfo.CurrencySymbol =

     

    "$";

     

    }

    I am having similar issues with the IsEnabled property (an earlier entry dated August 2008 says this property will be added in later release, and I am able to set it but it appears to have no effect).

    Ian

     

  2. Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 28 May 2009 Link to this post

    Hello Ian,

    I tested the reported issue. There is a problem with the NumberFormatInfo.CurrencySymbol which prevents from setting the proper symbol. We are using Microsoft's class not ours for this.

    The good thing is that there is two very simple workarounds:
    1. You can use CustomUnit property and set whatever you want, for example
    numeric1.CustomUnit= "$"       and it will show at the end of the value.

    2. Use this two lines:
            CultureInfo culture = new CultureInfo("fr-fr"); 
                radnumeric3.NumberFormatInfo.CurrencySymbol = culture.NumberFormat.CurrencySymbol; 

     Note that you need to have  set  ValueFormat= "Currency"  for the control.


    Kind regards,
    Boyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. DevCraft banner
  4. Ian
    Ian avatar
    51 posts
    Member since:
    Apr 2009

    Posted 28 May 2009 Link to this post

    Hi Boyen,

    Thanks for this. I used a different workaround for the currency issue but will switch to yours when I get a chance.

    You didn't address the problem with the "IsEnabled" property (I should probably raise a new thread but didn't want to clutter the forums up with too many issues).  Although the property is there and disables input it doesn't "grey out" the control the way the standard controls do. Obviously I can write code to do this myself using Opacity (and have done), but I feel the action of the IsEnabled property should be the same across all controls.
  5. Answer
    Boyan
    Admin
    Boyan avatar
    758 posts

    Posted 29 May 2009 Link to this post

    Hello Ian,

    Sorry for not replying you about the IsEnabled property. We know that the control is not grayed out, we have one or two other controls with the same behavior. We are currently fixing this in order to achieve consistency with the other controls. We expect to finalize this task with the official release of Q2 at the latest.

    Regards,
    Boyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top