Blank dates on form

When saving a form with a blank date that is not required, I get an exception "System.InvalidOperationException: Nullable object must have a value". The field is a DateTime?. I do not see a default value setting. The database is set for the field to be nullable. I would like the form to save the date to the database as NULL if possible.

Please advise! Thanks!

Can you post the full stack trace?

@enchev

Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer: Warning: Unhandled exception rendering component: Nullable object must have a value.

System.InvalidOperationException: Nullable object must have a value.
at System.Nullable1.get_Value() at FormalProbation.Pages.WorksheetEdit.<BuildRenderTree>b__0_2(RenderTreeBuilder __builder3) at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment) at Microsoft.AspNetCore.Components.CascadingValue1.Render(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
Microsoft.AspNetCore.Components.Server.Circuits.CircuitHost: Error: Unhandled exception in circuit 'B8YzlB_a-H_9Xqryxfood-C1ihysTTwrI47wPkH_XyA'.

System.InvalidOperationException: Nullable object must have a value.
at System.Nullable1.get_Value() at FormalProbation.Pages.WorksheetEdit.<BuildRenderTree>b__0_2(RenderTreeBuilder __builder3) at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment) at Microsoft.AspNetCore.Components.CascadingValue1.Render(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
[2020-07-08T20:18:10.081Z] Error: System.InvalidOperationException: Nullable object must have a value.
at System.Nullable1.get_Value() at FormalProbation.Pages.WorksheetEdit.<BuildRenderTree>b__0_2(RenderTreeBuilder __builder3) at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment) at Microsoft.AspNetCore.Components.CascadingValue1.Render(RenderTreeBuilder builder)
at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()
[2020-07-08T20:18:10.082Z] Information: Connection disconnected.
Microsoft.AspNetCore.Routing.EndpointMiddleware: Information: Executed endpoint '/_blazor'
Microsoft.AspNetCore.Hosting.Diagnostics: Information: Request finished in 43755.7645ms 101

@enchev I have some new information. I am actually getting this error if there is a date in the field and I clear it out and change focus to another field, it throws the above error.

I'm unable to reproduce such exception. Here is a test table definition I've used to create CRUD pages:

If you have Radzen license you can send us the project at info@radzen.com to debug it.