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

How do you set distinct value for number of decimals for multiple radnumericupdown controls

1 Answer 88 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
FieldTRAKS
Top achievements
Rank 1
FieldTRAKS asked on 22 Oct 2009, 08:10 PM
Hello,

I currently have code that automatically generates my dialogs by parsing an xml file that gives metadata about each control that should be rendered. Consequently, I have some dialogs that have multiple numericupdown controls that have different requirements for the number of decimals that should be displayed. My routine sets each numeric format as it goes through the loop of controls. However, the last numeric format is applied to all controls which is not desired. How do I set the number od decimals to be distinct on different controls. IT appears that the NumberFormatInfo.NumberDecimalDigits is a global setting as opposed to a setting per control. Please help.

Matt



 Here is a snippet of my code:

foreach(Ctrl)
{
.....

try
                       {

//this gets the default value from the dialog metadata xml to determine how many decimals should be displayed
                           ((RadNumericUpDown)o).NumberFormatInfo.NumberDecimalDigits = ctrl.Def.ToString().Split('.')[1].Length;
                       }
                       catch
                       {
                           ((RadNumericUpDown)o).NumberFormatInfo.NumberDecimalDigits = 3;
                    
                       }


}

1 Answer, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 23 Oct 2009, 10:43 AM
Hello Matt,

I would recommend using Beta 2 of RadControls for Silverlight, which was released last week, where the problem with the decimal digits is fixed. You could check if the latest internal build works for you too:
http://www.telerik.com/account/downloads/internal-builds.aspx

Greetings,
Valeri Hristov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
NumericUpDown
Asked by
FieldTRAKS
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or