This question is locked. New answers and comments are not allowed.
Hello,
somtimes get the following NullReferenceException in RadDropDownButtons:
1.Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.2.StackTrace:3. bei Telerik.Windows.Controls.RadDropDownButton.<>c__DisplayClass2.<OnLoaded>b__0()We were puzzled and surprised, because we did not change anything and we have no idea why this occurs. the stacktrace is also very short and does not show from where it comes.
Looking at the Sourcecode we probably found the bug. There is a Dispatcher call without checking in the dispatcher call for NULL.
namespace Telerik.Windows.Controls{ [TelerikToolboxCategory("Navigation")] public class RadDropDownButton : RadButton, IPopupHost, IPopupWrapperOwner, IDisposable { private void OnLoaded(object sender, RoutedEventArgs e) { this.isLoaded = true; RadDropDownButton isOpen = sender as RadDropDownButton; if (isOpen != null && isOpen.popupWrapper != null) { base.Dispatcher.BeginInvoke(() => isOpen.popupWrapper.IsOpen = this.IsOpen); } } }}Please fix it like this:
namespace Telerik.Windows.Controls{ [TelerikToolboxCategory("Navigation")] public class RadDropDownButton : RadButton, IPopupHost, IPopupWrapperOwner, IDisposable { private void OnLoaded(object sender, RoutedEventArgs e) { this.isLoaded = true; RadDropDownButton isOpen = sender as RadDropDownButton; if (isOpen != null && isOpen.popupWrapper != null) { base.Dispatcher.BeginInvoke( () => { if(isOpen.popupWrapper != null { isOpen.popupWrapper.IsOpen = this.IsOpen; } }); } } }}