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

2 posts, 0 answers
  1. FieldTRAKS
    FieldTRAKS avatar
    25 posts
    Member since:
    Apr 2009

    Posted 22 Oct 2009 Link to this post


    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.


     Here is a snippet of my code:



    //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;
                               ((RadNumericUpDown)o).NumberFormatInfo.NumberDecimalDigits = 3;


  2. Valeri Hristov
    Valeri Hristov avatar
    2252 posts

    Posted 23 Oct 2009 Link to this post

    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:

    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.
Back to Top