NullReferenceException Thrown When Using DateTimeEdit.MaxDateTime/MinDateTime

Hi,

Recently when I updated the Syncfusion WPF UI version and used DateTimeEdit controls, I noticed the following bug which did not happen previously.

Version:19.1.0.58, .NET Core, MaterialLight/MaterialDark
Exception: System.NullReferenceException from PresentationFramework.dll
StackTrace:
   at Syncfusion.Windows.Shared.DateTimeEdit.OnMaxDateTimeChanged(DependencyPropertyChangedEventArgs args)
   at Syncfusion.Windows.Shared.DateTimeEdit.OnMaxDateTimeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.Controls.TextBox.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at System.Windows.Baml2006.WpfMemberInvoker.SetValue(Object instance, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
   at MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.SetValue(Object obj, XamlMember property, Object value)
   at System.Xaml.XamlObjectWriter.SetValue(Object inst, XamlMember property, Object value)
   at System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, Object value, Boolean onParent)
   at System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
   at System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(ObjectWriterContext ctx)
   at System.Xaml.XamlObjectWriter.WriteEndMember()
   at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
   at System.Windows.Markup.WpfXamlLoader.TransformNodes(XamlReader xamlReader, XamlObjectWriter xamlWriter, Boolean onlyLoadOneNode, Boolean skipJournaledProperties, Boolean shouldPassLineNumberInfo, IXamlLineInfo xamlLineInfo, IXamlLineInfoConsumer xamlLineInfoConsumer, XamlContextStack`1 stack, IStyleConnector styleConnector)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at ShSzStockHelper.Views.StrikePriceVolumeTab.InitializeComponent() in XXX\StrikePriceVolumeTab.xaml:line 1
Other details: If the property "MaxDateTime" and "MinDateTime" are set in XAML files, there will be a warning showing like "Object reference not set to an instance of an object". I tried to set them programmatically via CS files but the same exception would be thrown.

Could you please confirm this issue?

Regards,
Arvin

3 Replies 1 reply marked as answer

SG Sangeetha Ganesan Syncfusion Team May 3, 2021 11:24 AM UTC

Hi Arvin,  
 
Thanks for your patience. 
 
We have confirmed the reported issue " NullReferenceException occurs when min or max date is set to DateTimeEdit" from our end and logged a bug report on this. It will be included in our upcoming weekly nuget release expected to be delivered on 11th May 2021. You can track the status of the issue using the feedback link below. 
 
 
We appreciate your patience until then. 
 
Regards, 
Sangeetha G 



SG Sangeetha Ganesan Syncfusion Team May 12, 2021 03:36 PM UTC

Hi Arvin,    
   
Thanks for your patience.   
 
We have fixed the reported issue ” NullReferenceException occurs when min or max date is set to DateTimeEdit” from our end . It will be included in our 2021 Volume 1 SP1 release expected to be available within this week. We will intimate you once it gets released. We appreciate your patience until then. 
 
Regards, 
Sangeetha G 



BR Bharathi Rajakantham Syncfusion Team May 13, 2021 03:03 PM UTC

Hi Arvin, 
 
Thanks for your Patience. 
 
We are glad to announce that our Essential Studio 2021 Volume 1 Service pack v19.1.0.63 is rolled out and the reported issue “Null Reference exception on setting Min and MaxdDatetime” is fixed and included. It is available for download under the following link. 
 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Bharathi R 


Marked as answer
Loader.
Up arrow icon