Hello,
trying to bind a RadNumericUpDown to a integer in a datatemplate:
My Value proerty is defined this way:
the GetValue returns an Integer while the SetValue try to convert the value into integer.
The problem is that I can't see anything in the NumericUpDown box. When I try to put a value inside, I can see into the debug that it is sending a double value like 1.0 or 2.0 to my property (this is not desired, but by now I can convert and store it as an integer). At the moment that the binding reads my proerty Value, I get an error in the output window saying:
'ObjectSourceConverter' converter failed to convert value '100' (type 'Int32'); fallback value will be used, if available. BindingExpression:Path=Value; DataItem='IntTupleInput' (HashCode=64515557); target element is 'RadNumericUpDown' (Name=''); target property is 'Value' (type 'Nullable`1') NotSupportedException:'System.NotSupportedException: DoubleConverter cannot convert from System.Int32.
in MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)
in MS.Internal.Data.ObjectSourceConverter.Convert(Object o, Type type, Object parameter, CultureInfo culture)
this also happen if I try to bind directy to the Integer property int CurrentValue that stores the value (instead of an "object" Value property)
Could you please clarify this behavior??
Thanks,
Simone
trying to bind a RadNumericUpDown to a integer in a datatemplate:
<
DataTemplate
DataType
=
"{x:Type datatypes:IntTupleInput}"
>
<
telerik:RadNumericUpDown
Value
=
"{Binding Value}"
IsInteger
=
"True"
ValueFormat
=
"Numeric"
/>
</
DataTemplate
>
My Value proerty is defined this way:
public override object Value
{
get
{
return GetValue();
}
set
{
if (IsLinked)
throw new RVExecutorException(this, "Non è possibile impostare il valore di un dato che è collegato ad un altro.");
else
SetValue(value);
FirePropertyChanged("Value");
}
}
the GetValue returns an Integer while the SetValue try to convert the value into integer.
The problem is that I can't see anything in the NumericUpDown box. When I try to put a value inside, I can see into the debug that it is sending a double value like 1.0 or 2.0 to my property (this is not desired, but by now I can convert and store it as an integer). At the moment that the binding reads my proerty Value, I get an error in the output window saying:
'ObjectSourceConverter' converter failed to convert value '100' (type 'Int32'); fallback value will be used, if available. BindingExpression:Path=Value; DataItem='IntTupleInput' (HashCode=64515557); target element is 'RadNumericUpDown' (Name=''); target property is 'Value' (type 'Nullable`1') NotSupportedException:'System.NotSupportedException: DoubleConverter cannot convert from System.Int32.
in MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)
in MS.Internal.Data.ObjectSourceConverter.Convert(Object o, Type type, Object parameter, CultureInfo culture)
this also happen if I try to bind directy to the Integer property int CurrentValue that stores the value (instead of an "object" Value property)
Could you please clarify this behavior??
Thanks,
Simone