Bug Report T1284373
Visible to All Users

DateNavigator with IsMultiselect set to False throws an exception when MinValue and MaxValue are set to a range that does not include FocusedDate

created 6 days ago

Steps to reproduce:

  1. Run the attached application.
  2. Select a date in DateNavigator.
  3. Select a date range such that FocusedDate falls outside the range.
  4. Click Apply range.

Expected results:

DateNavigator adjusts FocusedDate to fit the date range.

Current results:

DateNavigator throws an exception.

Additional information:

The attached project, screencast, and call stack illustrate the problematic behavior.

Call Stack
at DevExpress.Xpf.Editors.DateNavigator.SingleSelectionNavigationStrategy.CheckSelectedDates() at DevExpress.Xpf.Editors.DateNavigator.DateNavigator.OnSelectedDatesChanged(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index) at System.Collections.ObjectModel.Collection`1.Remove(T item) at DevExpress.Xpf.Editors.DateNavigator.DateNavigator.CoerceSelectedDates(Object value) at DevExpress.Xpf.Editors.DateNavigator.DateNavigator.<>c.<.cctor>b__42_14(DependencyObject d, Object value) at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp, PropertyMetadata metadata, EntryIndex& entryIndex, Int32& targetIndex, EffectiveValueEntry& newEntry, EffectiveValueEntry& oldEntry, Object& oldValue, Object baseValue, Object controlValue, CoerceValueCallback coerceValueCallback, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, Boolean skipBaseValueChecks) 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.CoerceValue(DependencyProperty dp) at DevExpress.Xpf.Editors.DateNavigator.DateNavigator.PropertyChangedMinValue(Nullable`1 oldValue) at DevExpress.Xpf.Editors.DateNavigator.DateNavigator.<>c.<.cctor>b__42_22(DependencyObject d, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.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.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue) at System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange) at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange) at System.Windows.Data.BindingExpression.ScheduleTransfer(Boolean isASubPropertyChange) at MS.Internal.Data.ClrBindingWorker.NewValueAvailable(Boolean dependencySourcesChanged, Boolean initialValue, Boolean isASubPropertyChange) at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange) at MS.Internal.Data.ClrBindingWorker.OnSourcePropertyChanged(Object o, String propName) at MS.Internal.Data.PropertyPathWorker.OnPropertyChanged(Object sender, PropertyChangedEventArgs e) at System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType) at System.ComponentModel.PropertyChangedEventManager.OnPropertyChanged(Object sender, PropertyChangedEventArgs args) at DevExpress.Mvvm.BindableBase.RaisePropertyChanged(String propertyName) at DevExpress.Mvvm.BindableBase.SetPropertyCore[T](String propertyName, T value, T& oldValue) at DevExpress.Mvvm.BindableBase.SetPropertyCore[T](String propertyName, T value, Action changedCallback) at DevExpress.Mvvm.BindableBase.SetProperty[T](Expression`1 expression, T value, Action changedCallback) at DevExpress.Mvvm.BindableBase.SetProperty[T](Expression`1 expression, T value) at DateNavigatorIssue.MainViewModel.set_MinDate(Nullable`1 value) in C:\work\projects\DateNavigatorIssue\DateNavigatorIssue\MainWindow.xaml.cs:line 31 at DateNavigatorIssue.MainViewModel.ApplyRange() in C:\work\projects\DateNavigatorIssue\DateNavigatorIssue\MainWindow.xaml.cs:line 64
Comments (2)

    Hello,

    Any update on the fix? I'm waiting for the fix. It used to work fine with v20.2. Please let me know.

    Andrey Marten (DevExpress Support) 2 days ago

      Hello Brad,

      We received this report the previous week and just started our research in this regard. It may take time to thoroughly research the cause of this issue and find a suitable solution. We will update this thread once we have news. Please keep track of our announcements.

      Regards,
      Andrey

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.