This is a migrated thread and some comments may be shown as answers.

How to change currency symbol?

3 Answers 129 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 26 May 2009, 11:18 AM
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

 

3 Answers, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 28 May 2009, 11:14 AM
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.
0
Ian
Top achievements
Rank 1
answered on 28 May 2009, 12:04 PM
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.
0
Accepted
Boyan
Telerik team
answered on 29 May 2009, 02:42 PM
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.
Tags
NumericUpDown
Asked by
Ian
Top achievements
Rank 1
Answers by
Boyan
Telerik team
Ian
Top achievements
Rank 1
Share this question
or