This question is locked. New answers and comments are not allowed.
OS: Windows 8 RP
RAD Version: 2012.1.712.0
Repro: https://github.com/shiftkey/radcontrol-repros/tree/master/DatePickerBinding
Using the DatePicker in a project and I see binding exceptions when I bind to a DateTime property:
1) Set the DataContext without populating the value:
Error: Converter failed to convert value of type 'System.DateTime' to type 'DateTime>'; BindingExpression: Path='DateTime' DataItem='DatePickerBinding.ShellViewModel, DatePickerBinding, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; target element is 'Telerik.UI.Xaml.Controls.RadDatePicker' (Name='null'); target property is 'Value' (type 'DateTime>').
2) Following on from scenario 1), use the RadDatePicker to set the date:
Error: Cannot save value from target back to source. BindingExpression: Path='DateTime' DataItem='DatePickerBinding.ShellViewModel, DatePickerBinding, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; target element is 'Telerik.UI.Xaml.Controls.RadDatePicker' (Name='null'); target property is 'Value' (type 'DateTime>').
The type mentioned in the error messages is interesting, couldn't spot anything out of the ordinary in how the control behaves through dotPeek.
3) Binding to a Nullable<DateTime> property throws a runtime exception:
System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.UI.Xaml.Controls.DateTimePicker.get_Value()
at Telerik.UI.Xaml.Controls.DateTimePicker.SyncPickerButtonContent()
at Telerik.UI.Xaml.Controls.DateTimePicker.OnEmptyContentChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
at Windows.UI.Xaml.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.UI.Xaml.Controls.DateTimePicker.set_EmptyContent(Object value)
at Telerik.UI.Xaml.Controls.RadDatePicker.OnTemplateApplied()
at Telerik.UI.Xaml.Controls.RadControl.OnApplyTemplate()
Is this supported?
RAD Version: 2012.1.712.0
Repro: https://github.com/shiftkey/radcontrol-repros/tree/master/DatePickerBinding
Using the DatePicker in a project and I see binding exceptions when I bind to a DateTime property:
1) Set the DataContext without populating the value:
Error: Converter failed to convert value of type 'System.DateTime' to type 'DateTime>'; BindingExpression: Path='DateTime' DataItem='DatePickerBinding.ShellViewModel, DatePickerBinding, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; target element is 'Telerik.UI.Xaml.Controls.RadDatePicker' (Name='null'); target property is 'Value' (type 'DateTime>').
2) Following on from scenario 1), use the RadDatePicker to set the date:
Error: Cannot save value from target back to source. BindingExpression: Path='DateTime' DataItem='DatePickerBinding.ShellViewModel, DatePickerBinding, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'; target element is 'Telerik.UI.Xaml.Controls.RadDatePicker' (Name='null'); target property is 'Value' (type 'DateTime>').
The type mentioned in the error messages is interesting, couldn't spot anything out of the ordinary in how the control behaves through dotPeek.
System.NullReferenceException: System.NullReferenceException: Object reference not set to an instance of an object.
at Telerik.UI.Xaml.Controls.DateTimePicker.get_Value()
at Telerik.UI.Xaml.Controls.DateTimePicker.SyncPickerButtonContent()
at Telerik.UI.Xaml.Controls.DateTimePicker.OnEmptyContentChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
at Windows.UI.Xaml.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Telerik.UI.Xaml.Controls.DateTimePicker.set_EmptyContent(Object value)
at Telerik.UI.Xaml.Controls.RadDatePicker.OnTemplateApplied()
at Telerik.UI.Xaml.Controls.RadControl.OnApplyTemplate()
Is this supported?