Bug 32144 - DatePicker cannot be bound to a Nullable DateTime.
Summary: DatePicker cannot be bound to a Nullable DateTime.
Status: RESOLVED INVALID
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 1.4.4
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Stephane Delcroix
URL:
Depends on:
Blocks:
 
Reported: 2015-07-20 11:12 UTC by Brad Chase
Modified: 2017-04-04 22:17 UTC (History)
7 users (show)

Tags: AC
Is this bug a regression?: ---
Last known good build:


Attachments
Example (3.83 MB, application/octet-stream)
2015-07-20 11:12 UTC, Brad Chase
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Brad Chase 2015-07-20 11:12:14 UTC
Created attachment 12112 [details]
Example

DatePicker can be bound to a nullable datetime under Android.  When under iOS it will crash the app.  The current work around is to build a wrapper around the DatePicker which converts the DateTime with a proxy DateTime? property.

See Attached Project.
Comment 1 Stephane Delcroix 2015-07-21 05:25:33 UTC
Fails on Android too
Comment 2 Ram Chandra 2015-08-07 08:39:07 UTC
I have checked this issue and I am able to reproduce the reported behavior. I observed that we are unable to bound date time with nullable on both android and iOS.

Debug logs: https://gist.github.com/Arpit360/987cb1ea2497f300c83d
Adb Logs: https://gist.github.com/Arpit360/a474e1d75cc5076a5dfd

Environment Info: 

Xamarin.Forms:  1.4.4.6392

Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional

LightSwitch for Visual Studio 2013   06177-004-0446016-02312
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06177-004-0446016-02312
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06177-004-0446016-02312
Microsoft Visual Basic 2013

Visual C# 2013   06177-004-0446016-02312
Microsoft Visual C# 2013

Visual C++ 2013   06177-004-0446016-02312
Microsoft Visual C++ 2013

Visual F# 2013   06177-004-0446016-02312
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06177-004-0446016-02312
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU   06177-004-0446016-02312
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   1.0
Application Insights Tools for Visual Studio

ASP.NET and Web Tools   12.4.51016.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Websites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.21010.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.3
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Microsoft Advertising SDK for Windows Phone   
Microsoft Advertising SDK for Windows Phone
Build 

Microsoft Azure Mobile Services Tools   1.3
Microsoft Azure Mobile Services Tools

NuGet Package Manager   2.8.60318.734
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2013 ENU   12.0.30626
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PowerShell Tools   1.3
Provides file classification services using PowerShell

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SAPReferenceManager   1.0
Manages References to Shared Projects

SQL Server Data Tools   12.0.41012.0
Microsoft SQL Server Data Tools

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin   3.11.816.0 (cefca47)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   5.1.5.2 (2e8568c9f3a3ce0b66203412a268b39618824338)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.Forms Intellisense   1.0
Provides intellisense for Xamarin.Forms in the XML editor.

Xamarin.iOS   8.10.4.0 (099f94bba4532201864249a9064bf73be56f8667)
Visual Studio extension to enable development for Xamarin.iOS.

Xamarin.iOS Unified Migration   1.0
Automated migration for Xamarin iOS Classic projects to Unified

Xamarin.TestCloud.Integration   1.0
Early preview of Xamarin Test Cloud integration
Comment 3 Jason Smith [MSFT] 2016-04-11 08:31:12 UTC
This is expected behavior
Comment 4 tancev 2017-04-04 22:17:31 UTC
I am encountering same error

	
DatePicker.CoerceDate(Xamarin.Forms.BindableObject bindable, System.Object value)
System.NullReferenceException: Object reference not set to an instance of an object

Info taken from HockeyApp

Xamarin.Forms.DatePicker.CoerceDate(BindableObject bindable, object value)
Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, object value, BindableObject.SetValueFlags attributes, BindableObject.SetValuePrivateFlags privateAttributes)
Xamarin.Forms.BindingExpression.ApplyCore(object sourceObject, BindableObject target, BindableProperty property, bool fromTarget)
Xamarin.Forms.BindingExpression.Apply(object sourceObject, BindableObject target, BindableProperty property)
Xamarin.Forms.Binding.Apply(object newContext, BindableObject bindObj, BindableProperty targetProperty)
Xamarin.Forms.BindableObject.ApplyBindings(bool skipBindingContext)
Xamarin.Forms.BindableObject.ApplyBindings()
Xamarin.Forms.BindableObject.SetInheritedBindingContext(BindableObject bindable, object value)
Xamarin.Forms.Element.SetChildInheritedBindingContext(Element child, object context)
Xamarin.Forms.Element.OnBindingContextChanged()
Xamarin.Forms.View.OnBindingContextChanged()
Xamarin.Forms.BindableObject.SetInheritedBindingContext(BindableObject bindable, object value)
Xamarin.Forms.Element.SetChildInheritedBindingContext(Element child, object context)
Xamarin.Forms.TemplatedPage.SetChildInheritedBindingContext(Element child, object context)
Xamarin.Forms.Element.OnBindingContextChanged()
Xamarin.Forms.Page.OnBindingContextChanged()
Xamarin.Forms.ContentPage.OnBindingContextChanged()
Xamarin.Forms.BindableObject.BindingContextPropertyChanged(BindableObject bindable, object oldvalue, object newvalue)
Xamarin.Forms.BindableObject.SetValueActual(BindableProperty property, BindableObject.BindablePropertyContext context, object value, bool currentlyApplying, BindableObject.SetValueFlags attributes, bool silent)
Xamarin.Forms.BindableObject.SetValueCore(BindableProperty property, object value, BindableObject.SetValueFlags attributes, BindableObject.SetValuePrivateFlags privateAttributes)
Xamarin.Forms.BindableObject.SetValue(BindableProperty property, object value, bool fromStyle, bool checkAccess)
Xamarin.Forms.BindableObject.SetValue(BindableProperty property, object value)
Xamarin.Forms.BindableObject.set_BindingContext(object value)
Workango.Mobile.Views.LoggedUserProfileView.LoggedUserProfileView()
Workango.Mobile.Views.SideView.ProfileImageTapped()
UIKit.UIKitSynchronizationContext.<Post>c__AnonStorey0.<>m__0()
Foundation.NSAsyncActionDispatcher.Apply()
UIKit.UIApplication.UIApplicationMain(int, string[], intptr, intptr)(wrapper managed-to-native)
UIKit.UIApplication.Main(string[] args, IntPtr principal, IntPtr delegate)
UIKit.UIApplication.Main(string[] args, string principalClassName, string delegateClassName)
Workango.Mobile.iOS.Application.Main(string[] args)