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;
}
}
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;
}
}