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

Set the $ Currency symbol

1 Answer 579 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Krish
Top achievements
Rank 1
Krish asked on 26 Nov 2018, 02:29 PM
I'm unable to set the $ currency symbol as well as decimal places for radspinEditor, Please check image and do the needful.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 27 Nov 2018, 06:15 AM
Hello, Krish,   

RadSpinEditor is a themable alternative to the standard Windows Numeric Up Down control. It allows users to set/edit a number in a text box by using up and down buttons however extends this functionality by providing skinning and consistent look and feel with the other controls in the Telerik UI for WinForms suite.

In order to show the currency symbol, it is recommended to use a RadMaskedEditBox with currency mask:

this.radMaskedEditBox1.MaskType = Telerik.WinControls.UI.MaskType.Numeric;
this.radMaskedEditBox1.Mask = "C";
this.radMaskedEditBox1.Value = 123.45;

However, you can add a RadLabelElement to the RadSpinEditor and display the CurrencySymbol:

RadLabelElement currencyLabel = new RadLabelElement();
currencyLabel.Text = NumberFormatInfo.CurrentInfo.CurrencySymbol.ToString();
currencyLabel.Padding = new System.Windows.Forms.Padding(0, 0,2, 0);
  
RadTextBoxItem tbItem = this.radSpinEditor1.SpinElement.TextBoxItem;
StackLayoutElement spinElementLayout = this.radSpinEditor1.SpinElement.Children.Last() as StackLayoutElement;
spinElementLayout.Children.Remove(tbItem);
  
DockLayoutPanel dockPanel = new DockLayoutPanel();
dockPanel.Children.Add(currencyLabel);
dockPanel.Children.Add(tbItem);
DockLayoutPanel.SetDock(tbItem, Telerik.WinControls.Layouts.Dock.Left);
spinElementLayout.Children.Insert(0, dockPanel);



Note that most of the forum threads are reviewed by Telerik representatives and sometimes we address the questions asked by our customers in the forums as well. However, a post in the forum doesn't guarantee you a response from the Telerik support team. Moreover, threads are handled according to license and time of posting. If you have any further questions, I would kindly ask you to submit a support ticket from your account. Thus, our support staff will gladly assist you.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
MaskedEditBox
Asked by
Krish
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or