Hello, I've discovered an issue, and I'd like to see if this is some sort of desired behavior or a bug. Here's the deal, I've got a bunch of RadNumericUpDown controls, each lies within a UserControl. and that UserControl is bould to an object. the RadNumericUpDown XAML looks like this.
<telerik:RadNumericUpDown Grid.Column="1" |
x:Name="inpPMax" Style="{StaticResource InputNumbers}" |
ValueFormat="Numeric" NumberFormatInfo="{Binding Path=DisplayFormat}" |
IsEnabled="{Binding Path=UserEntered}" |
Minimum="{Binding Path=Minimum}" Maximum="{Binding Path=Maximum}" |
SmallChange=".1" LargeChange="1" GotFocus="inpPMax_GotFocus" ValueChanged="inpPMax_ValueChanged"> |
<telerik:RadNumericUpDown.Value> |
<Binding Path="DisplayValue" UpdateSourceTrigger="PropertyChanged" ValidatesOnDataErrors="True"/> |
</telerik:RadNumericUpDown.Value> |
</telerik:RadNumericUpDown> |
and the syle I'm using looks like this
<Style x:Key="InputNumbers" TargetType="{x:Type telerik:RadNumericUpDown}"> |
<Setter Property="Height" Value="25"/> |
<Setter Property="FontSize" Value="12"/> |
<Setter Property="Margin" Value="2"/> |
<Setter Property="HorizontalContentAlignment" Value="Right"/> |
<Style.Triggers> |
<Trigger Property="Validation.HasError" Value="true"> |
<Setter Property="ToolTip" |
Value="{Binding RelativeSource={RelativeSource Self}, |
Path=(Validation.Errors)[0].ErrorContent}"/> |
</Trigger> |
<Trigger Property="Validation.HasError" Value="false"> |
<Setter Property="ToolTip" Value=""/> |
</Trigger> |
</Style.Triggers> |
</Style> |
The behavior I'm noticing is that when I enter "1000" in the text field, the control resets it back to 0, actually it looks like it sets it back to "000.000". I thought that it might be doing this because I set the min and max values incorrectly, but when I debug into the "inpPMax_ValueChanged" method, I see that the control's max is set to double.maxvalue, and min is set to double.minvalue which means to me that it should't be failing this test. I've also tried hard coding these values to 0.0, and 10000 respectively, with the same results.
I've noticed that if I enter 1999 (which is larget then (1000), the control resets the value to "999", to me it seems that the control is only taking the first 3 degits. One other thing to note is that the binding for NumberFormatInfo looks like this.
public NumberFormatInfo DisplayFormat |
{ |
get |
{ |
var ret = (NumberFormatInfo)CultureInfo.CurrentCulture.NumberFormat.Clone(); |
ret.NumberDecimalDigits = DecimalPlaces; |
return ret; |
} |
} |
protected virtual int DecimalPlaces { get { return 0; } } |
This is because some "measurements" require 3 decimal places, while others require 0 and the control just binds to the "measurement"s DisplayFormat property.
it's going to be difficult to send any more code, but I'd greatly appreciate any help here, and I'll send whatever you ask for, if I can't get this to work I'll have to go back to a textbox, and I really don't want to do that.