Completed
Last Updated: 10 Dec 2021 08:52 by ADMIN
Release LIB 2021.3.1129 (29 Nov 2021)
Simon
Created on: 27 Oct 2021 09:58
Category: UI for WPF
Type: Bug Report
1
AutoCompleteBox: RadAutoCompleteBox hosted in RadTabControl causes NullReferenceException

Hi,

we recently found that our software crashes as soon as we include a RadAutoCompleteBox in the content of a RadTabControl.

A repro project is attached to this report.

How to reproduce:

  • Add a RadAutoCompleteBox to the ContentTemplate of a RadTabControl and bind its ItemsSource to any collection (the project is set up accordingly).
  • Run the application
  • Change the active tab twice. The first click should work, the second click should crash the application without any user code in the stack trace.

You will get a stack trace similar to the one below.

 

Best regards

Simon Müller

Hofmann Fördertechnik GmbH

>	PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadTemplateXaml(System.Xaml.XamlReader templateReader, System.Xaml.XamlObjectWriter currentWriter)	Unknown
 	PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(System.Windows.DependencyObject container, System.Windows.Markup.IComponentConnector componentConnector, System.Windows.Markup.IStyleConnector styleConnector, System.Collections.Generic.List<System.Windows.DependencyObject> affectedChildren, System.Windows.UncommonField<System.Collections.Hashtable> templatedNonFeChildrenField)	Unknown
 	PresentationFramework.dll!System.Windows.FrameworkTemplate.LoadContent(System.Windows.DependencyObject container, System.Collections.Generic.List<System.Windows.DependencyObject> affectedChildren)	Unknown
 	PresentationFramework.dll!System.Windows.StyleHelper.ApplyTemplateContent(System.Windows.UncommonField<System.Collections.Specialized.HybridDictionary[]> dataField, System.Windows.DependencyObject container, System.Windows.FrameworkElementFactory templateRoot, int lastChildIndex, System.Collections.Specialized.HybridDictionary childIndexFromChildID, System.Windows.FrameworkTemplate frameworkTemplate)	Unknown
 	PresentationFramework.dll!System.Windows.FrameworkTemplate.ApplyTemplateContent(System.Windows.UncommonField<System.Collections.Specialized.HybridDictionary[]> templateDataField, System.Windows.FrameworkElement container)	Unknown
 	PresentationFramework.dll!System.Windows.FrameworkElement.ApplyTemplate()	Unknown
 	Telerik.Windows.Controls.dll!Telerik.Windows.Controls.ItemsControlExtensions.GetItemsPanelRecursive(System.Windows.DependencyObject control)	Unknown
 	Telerik.Windows.Controls.dll!Telerik.Windows.Controls.ItemsControlExtensions.GetItemsPanelRecursive(System.Windows.DependencyObject control)	Unknown
 	Telerik.Windows.Controls.dll!Telerik.Windows.Controls.ItemsControlExtensions.GetItemsPanelRecursive(System.Windows.DependencyObject control)	Unknown
 	Telerik.Windows.Controls.dll!Telerik.Windows.Controls.ItemsControlExtensions.GetItemsPanelRecursive(System.Windows.DependencyObject control)	Unknown
 	Telerik.Windows.Controls.dll!Telerik.Windows.Controls.ItemsControlExtensions.GetItemsPanel(System.Windows.DependencyObject itemsControl)	Unknown
 	Telerik.Windows.Controls.dll!Telerik.Windows.Controls.Primitives.ItemsControlSelector.CanPerformSelection()	Unknown
 	Telerik.Windows.Controls.dll!Telerik.Windows.Controls.Primitives.ListControl.CanPerformSelection()	Unknown
 	Telerik.Windows.Controls.dll!Telerik.Windows.Controls.Primitives.ItemsControlSelector.OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)	Unknown
 	Telerik.Windows.Controls.dll!Telerik.Windows.Controls.RadListBox.OnItemsChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.ItemsControl.OnItemCollectionChanged2(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)	Unknown
 	PresentationFramework.dll!System.Windows.Data.CollectionView.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs args)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.ItemCollection.OnViewCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.WeakEventManager.ListenerList<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.DeliverEvent(object sender, System.EventArgs e, System.Type managerType)	Unknown
 	WindowsBase.dll!System.Windows.WeakEventManager.DeliverEvent(object sender, System.EventArgs args)	Unknown
 	WindowsBase.dll!System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs args)	Unknown
 	PresentationFramework.dll!System.Windows.Data.CollectionView.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs args)	Unknown
 	PresentationFramework.dll!MS.Internal.Data.EnumerableCollectionView._OnViewChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs args)	Unknown
 	PresentationFramework.dll!System.Windows.Data.CollectionView.OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs args)	Unknown
 	PresentationFramework.dll!System.Windows.Data.ListCollectionView.RefreshOverride()	Unknown
 	PresentationFramework.dll!System.Windows.Data.CollectionView.RefreshInternal()	Unknown
 	PresentationFramework.dll!System.Windows.Data.CollectionView.Refresh()	Unknown
 	PresentationFramework.dll!System.Windows.Data.CollectionView.EndDefer()	Unknown
 	PresentationFramework.dll!System.Windows.Data.CollectionView.DeferHelper.Dispose()	Unknown
 	PresentationFramework.dll!System.Windows.Controls.ItemCollection.SetCollectionView(System.Windows.Data.CollectionView view)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.ItemCollection.SetItemsSource(System.Collections.IEnumerable value, System.Func<object, object> GetSourceItem)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.ItemsControl.OnItemsSourceChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	Telerik.Windows.Controls.dll!Telerik.Windows.Controls.Primitives.ListControl.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty dp, bool preserveCurrentValue)	Unknown
 	PresentationFramework.dll!System.Windows.StyleHelper.InvalidateDependents(System.Windows.Style ownerStyle, System.Windows.FrameworkTemplate frameworkTemplate, System.Windows.DependencyObject container, System.Windows.DependencyProperty dp, ref MS.Utility.FrugalStructList<System.Windows.ChildPropertyDependent> dependents, bool invalidateOnlyContainer)	Unknown
 	PresentationFramework.dll!System.Windows.StyleHelper.OnTriggerSourcePropertyInvalidated(System.Windows.Style ownerStyle, System.Windows.FrameworkTemplate frameworkTemplate, System.Windows.DependencyObject container, System.Windows.DependencyProperty dp, System.Windows.DependencyPropertyChangedEventArgs changedArgs, bool invalidateOnlyContainer, ref MS.Utility.FrugalStructList<MS.Utility.ItemStructMap<System.Windows.TriggerSourceRecord>> triggerSourceRecordFromChildIndex, ref MS.Utility.FrugalMap propertyTriggersWithActions, int sourceChildIndex)	Unknown
 	PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyPropertyKey key, object value)	Unknown
 	Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.RadAutoCompleteBox.FilteredItems.set(System.Collections.IEnumerable value)	Unknown
 	Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.RadAutoCompleteBox.Telerik.Windows.Controls.Primitives.IAutocompleteInteraction.FilteredItems.set(System.Collections.IEnumerable value)	Unknown
 	Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.Primitives.AutoCompleteHelper.OnFilteringCompleted(System.Collections.Generic.IEnumerable<object> items)	Unknown
 	Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.Primitives.AutoCompleteHelper.Populate(string text)	Unknown
 	Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.RadAutoCompleteBox.Populate(string searchText)	Unknown
 	Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.RadAutoCompleteBox.OnItemsSourceChanged(object newValue, object oldValue)	Unknown
 	Telerik.Windows.Controls.Input.dll!Telerik.Windows.Controls.RadAutoCompleteBox.OnItemsSourceChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty dp, bool preserveCurrentValue)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty dp)	Unknown
 	PresentationFramework.dll!System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode(System.Windows.DependencyObject container, MS.Internal.FrameworkObject child, int childIndex, ref MS.Utility.FrugalStructList<System.Windows.ChildRecord> childRecordFromChildIndex, bool isDetach, System.Windows.FrameworkElementFactory templateRoot)	Unknown
 	PresentationFramework.dll!System.Windows.StyleHelper.ClearTemplateChain(System.Collections.Specialized.HybridDictionary[] instanceData, System.Windows.FrameworkElement feContainer, System.Windows.FrameworkContentElement fceContainer, System.Collections.Generic.List<System.Windows.DependencyObject> templateChain, System.Windows.FrameworkTemplate oldFrameworkTemplate)	Unknown
 	PresentationFramework.dll!System.Windows.StyleHelper.ClearGeneratedSubTree(System.Collections.Specialized.HybridDictionary[] instanceData, System.Windows.FrameworkElement feContainer, System.Windows.FrameworkContentElement fceContainer, System.Windows.FrameworkTemplate oldFrameworkTemplate)	Unknown
 	PresentationFramework.dll!System.Windows.StyleHelper.DoTemplateInvalidations(System.Windows.FrameworkElement feContainer, System.Windows.FrameworkTemplate oldFrameworkTemplate)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.ContentPresenter.OnTemplateChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty dp, object value)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.ContentPresenter.OnContentTemplateChanged(System.Windows.DataTemplate oldContentTemplate, System.Windows.DataTemplate newContentTemplate)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.ContentPresenter.OnContentTemplateChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.InvalidateProperty(System.Windows.DependencyProperty dp, bool preserveCurrentValue)	Unknown
 	PresentationFramework.dll!System.Windows.StyleHelper.InvalidateDependents(System.Windows.Style ownerStyle, System.Windows.FrameworkTemplate frameworkTemplate, System.Windows.DependencyObject container, System.Windows.DependencyProperty dp, ref MS.Utility.FrugalStructList<System.Windows.ChildPropertyDependent> dependents, bool invalidateOnlyContainer)	Unknown
 	PresentationFramework.dll!System.Windows.StyleHelper.OnTriggerSourcePropertyInvalidated(System.Windows.Style ownerStyle, System.Windows.FrameworkTemplate frameworkTemplate, System.Windows.DependencyObject container, System.Windows.DependencyProperty dp, System.Windows.DependencyPropertyChangedEventArgs changedArgs, bool invalidateOnlyContainer, ref MS.Utility.FrugalStructList<MS.Utility.ItemStructMap<System.Windows.TriggerSourceRecord>> triggerSourceRecordFromChildIndex, ref MS.Utility.FrugalMap propertyTriggersWithActions, int sourceChildIndex)	Unknown
 	PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty dp, object value)	Unknown
 	Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.TabControl.RadTabControlBase.SelectedContentTemplate.set(System.Windows.DataTemplate value)	Unknown
 	Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabControl.UpdateSelectedContentProperties()	Unknown
 	Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.TabControl.RadTabControlBase.HandleSelectionChanged(System.Collections.IList removedItems, System.Collections.IList addedItems)	Unknown
 	Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.TabControl.RadTabControlBase.Selector_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.SelectionChangedEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget)	Unknown
 	PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target)	Unknown
 	PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs)	Unknown
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised)	Unknown
 	PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args)	Unknown
 	PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs e)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.Primitives.Selector.OnSelectionChanged(System.Windows.Controls.SelectionChangedEventArgs e)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.Primitives.Selector.InvokeSelectionChanged(System.Collections.Generic.List<System.Windows.Controls.ItemsControl.ItemInfo> unselectedInfos, System.Collections.Generic.List<System.Windows.Controls.ItemsControl.ItemInfo> selectedInfos)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.Primitives.Selector.SelectionChanger.End()	Unknown
 	PresentationFramework.dll!System.Windows.Controls.Primitives.Selector.SetSelectedHelper(object item, System.Windows.FrameworkElement UI, bool selected)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.Primitives.Selector.NotifyIsSelectedChanged(System.Windows.FrameworkElement container, bool selected, System.Windows.RoutedEventArgs e)	Unknown
 	PresentationFramework.dll!System.Windows.Controls.Primitives.Selector.OnSelected(object sender, System.Windows.RoutedEventArgs e)	Unknown
 	PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs)	Unknown
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised)	Unknown
 	PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args)	Unknown
 	PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs e)	Unknown
 	Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabItem.NotifyOwnerAboutChangedSelection(bool isSelected)	Unknown
 	Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabItem.OnIsSelectedChanged(bool oldValue, bool newValue)	Unknown
 	Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabItem.OnIsSelectedPropertyChanged(System.Windows.DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex, System.Windows.DependencyProperty dp, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, bool coerceWithCurrentValue, System.Windows.OperationType operationType, bool isInternal)	Unknown
 	WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty dp, object value)	Unknown
 	Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabItem.IsSelected.set(bool value)	Unknown
 	Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTabItem.OnHeaderMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)	Unknown
 	PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget)	Unknown
 	PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target)	Unknown
 	PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs)	Unknown
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised)	Unknown
 	PresentationCore.dll!System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args, System.Windows.RoutedEvent newEvent)	Unknown
 	PresentationCore.dll!System.Windows.UIElement.OnMouseDownThunk(object sender, System.Windows.Input.MouseButtonEventArgs e)	Unknown
 	PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget)	Unknown
 	PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target)	Unknown
 	PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs)	Unknown
 	PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source, System.Windows.RoutedEventArgs args, bool reRaised)	Unknown
 	PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender, System.Windows.RoutedEventArgs args)	Unknown
 	PresentationCore.dll!System.Windows.UIElement.RaiseTrustedEvent(System.Windows.RoutedEventArgs args)	Unknown
 	PresentationCore.dll!System.Windows.Input.InputManager.ProcessStagingArea()	Unknown
 	PresentationCore.dll!System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs input)	Unknown
 	PresentationCore.dll!System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport inputReport)	Unknown
 	PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.ReportInput(System.IntPtr hwnd, System.Windows.Input.InputMode mode, int timestamp, System.Windows.Input.RawMouseActions actions, int x, int y, int wheel)	Unknown
 	PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.FilterMessage(System.IntPtr hwnd, MS.Internal.Interop.WindowMessage msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)	Unknown
 	PresentationCore.dll!System.Windows.Interop.HwndSource.InputFilterMessage(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)	Unknown
 	WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled)	Unknown
 	WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o)	Unknown
 	WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs)	Unknown
 	WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler)	Unknown
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs)	Unknown
 	WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam)	Unknown
 	[Native to Managed Transition]	
 	[Managed to Native Transition]	
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame)	Unknown
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame frame)	Unknown
 	WindowsBase.dll!System.Windows.Threading.Dispatcher.Run()	Unknown
 	PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore)	Unknown
 	PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window)	Unknown
 	PresentationFramework.dll!System.Windows.Application.Run()	Unknown
 	WpfApp6.dll!WpfApp6.App.Main()	Unknown


Attached Files:
8 comments
ADMIN
Martin Ivanov
Posted on: 10 Dec 2021 08:52

Hello Simon,

I am glad to hear that the issue is resolved now. 

Yes, the fix affects also the AutoSuggestBox control. 

As for the style issue, yes, it will be better if you can open a separate thread. You can open a new support ticket from your account and attach a project there.

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Simon
Posted on: 08 Dec 2021 12:55

Hello Martin,

thank you again for the support - it looks like the LIB fixes the problem. I was not able to reproduce the crash after installing the 2021.3.1206-hotfix in both, the sample app and our main project.

And it seems like the patch also fixes the AutoSuggestBox which I recently realized had the same problem. Can you confirm that the fix affects both controls (AutoSuggestBox and AutoCompleteBox)?

Regarding the style issue: With the main problem now solved, it is no longer a particular problem for me. However, it might still be worth looking into. Should I create a new ticket for that issue with the example project from my last comment?

Regards,

Simon Müller

ADMIN
Martin Ivanov
Posted on: 03 Dec 2021 11:10

Hello Simon,

The Completed state means that the fix is already released (since this Monday). It isn't the exact solution that I've provided, but a bit more elegant approach. Anyway, this should be fixed now. Can you please test with the latest internal build and let me know if the issue is resolved also on your side?

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Simon
Posted on: 03 Dec 2021 06:48

Hi Martin,

thank you for your answer and no worries about the delay, I wasn't able to check in here in the last days anyway.

I just modified the test project to reproduce the issue with the missing style, see the attached project.

I noticed that this ticket went through the "In development" state and is now "Completed". Does this mean that the patch from your "CustomAutoCompleteBox" implementation was added to the original RadAutoCompleteBox code and I can expect the crash to be gone with the next Ui For WPF update? If that was the case I would probably go with the IsContentPreserved=True as a temporary fix since we have only two tab controls but a whole lot of AutoComplete- and AutoSuggestBoxes (which have the same issue) we would have to replace.

Attached Files:
ADMIN
Martin Ivanov
Posted on: 22 Nov 2021 11:23

Hello Simon,

Please excuse me for the delay.

Indeed, setting the IsContentPreserved to True will also resolve the exception. As for the style issue, I tried to recreate this in your sample project, but it looks like I am missing the exact setup. Can you show me how exactly the style is applied and what it contains?

An alternative solution that you can try is to override the OnItemsSourceChanged method of RadAutoCompleteBox and avoid the call that causes the error. For example:

 

public class CustomAutoCompleteBox : RadAutoCompleteBox
{
	protected override void OnItemsSourceChanged(object newValue, object oldValue)
	{
		var isLoadedField = typeof(RadAutoCompleteBox).GetField("isLoaded", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
		var isLoaded = (bool)isLoadedField.GetValue(this);
		if (isLoaded && this.Parent == null)
		{
			isLoadedField.SetValue(this, false);
			base.OnItemsSourceChanged(newValue, oldValue);
			isLoadedField.SetValue(this, true);
		}
		else
		{
			base.OnItemsSourceChanged(newValue, oldValue);
		}
	}
}

Note that because of the NoXaml usage in your setup, you will need to define a Style for the custom control that is based on the default RadAutoCompleteBoxStyle.

<Application.Resources>
	 <ResourceDictionary>
		 <ResourceDictionary.MergedDictionaries>
			 <ResourceDictionary Source="/Telerik.Windows.Controls;component/Themes/FontResources.xaml"/>
			 <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/System.Windows.xaml" />
			 <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.xaml" />
			 <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Input.xaml" />
			 <ResourceDictionary Source="/Telerik.Windows.Themes.Fluent;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
		 </ResourceDictionary.MergedDictionaries>
		<Style TargetType="local:CustomAutoCompleteBox" BasedOn="{StaticResource RadAutoCompleteBoxStyle}" />
	</ResourceDictionary>
</Application.Resources>

I also changed the status of this report the Unplanned and updated your Telerik points as a small gesture of gratitude for reporting this.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ADMIN
Martin Ivanov
Posted on: 09 Nov 2021 15:34

Hello Simon,

I will check the your new questions and provide some information as soon as possible.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Simon
Posted on: 02 Nov 2021 14:38

Hi Martin, thank you for your response.

Indeed, after adding that property, the exception is no longer happening - although I don't really get why because https://docs.telerik.com/devtools/wpf/controls/radtabcontrol/howto/how-to-allow-visual-elements specifically talks about binding to collections of visual elements while I am simply binding to ViewModels.

Regardless, it seems like setting the property brings its own problems:

1. The view's state becomes inconsistent with the state of the viewmodel, see attached gif: I select an item in Tab 1 and switch to Tab 2. When returning to Tab 1, the AutoCompleteBox is now "empty" (at least its SearchText is) although the bound property on my ViewModel is still set, as you can see in the Tab's header. When going back to Tab 2, the AutoCompleteBox I have never even focused now has the SearchText from Tab 1.
This problem can be fixed by also setting IsContentPreserved to true. However ...

2. ... having IsContentPreserved and SupressSelectedContentTemplateReapplying both set to true appearantly causes the RadWatermarkTextBox in the first tab to lose its (explicitly assigned) style (see attached gif). Strangely enough, that only happens for the first tab.

 

This is the full xaml for the AutoCompleteBox in our app:

<telerik:RadAutoCompleteBox Grid.Row="0" Grid.Column="1"
                            Margin="5 10 0 0"
                            SelectedItem="{Binding UnitSelectionComponent.SelectedUnit, Mode=TwoWay}"
                            ItemsSource="{Binding UnitSelectionComponent.SearchResults, Mode=OneWay}"
                            SearchText="{Binding UnitSelectionComponent.UnitNumberSearchText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                            DisplayMemberPath="UnitNumber"
                            AutoCompleteMode="SuggestAppend"
                            SelectionMode="Single"
                            TextSearchMode="Contains"
                            TextSearchPath="UnitNumber"
                            WatermarkContent="{StaticResource Loc.UnitNumber}"/>
ADMIN
Martin Ivanov
Posted on: 02 Nov 2021 13:47

Hello Simon,

Can you please set the SupressSelectedContentTemplateReapplying property of RadTabControl to True and let me know if this resolves the error?

 <telerik:RadTabControl ItemsSource="{Binding Pages}" SupressSelectedContentTemplateReapplying="True">
Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.