AutoBindBehavior crash with custom PropertyDefinitions and non-default PropertySetMode

4 posts, 0 answers
  1. Guy
    Guy avatar
    16 posts
    Member since:
    Mar 2012

    Posted 23 Jun Link to this post

    It looks like the AutoBindBehavior doesn't handle the case where custom PropertyDefinitions are used, a PropertySetMode of Union or Intersection is used and an IEnumerable is assigned to the PropertyGrid.Item. This results in a Linq exception: Sequence contains no elements with the following callstack:

       at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
       at Telerik.Windows.Controls.Data.PropertyGrid.AutoBindBehavior.BindEditor(FrameworkElement editorElement, DependencyProperty property)
       at Telerik.Windows.Controls.Data.PropertyGrid.AutoBindBehavior.<>c__DisplayClass4.<OnUpdateBindingOnElementLoaded>b__0(Object s, RoutedEventArgs args)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
       at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
       at MS.Internal.LoadedOrUnloadedOperation.DoWork()
       at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()

  2. Stefan X1
    Admin
    Stefan X1 avatar
    514 posts

    Posted 24 Jun Link to this post

    Hi Guy,

    I tried to reproduce such exception with the described setup, but to no avail. Can you please check out the sample application attached to my post and let me know in case I am missing something?

    Regards,
    Stefan X1
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Guy
    Guy avatar
    16 posts
    Member since:
    Mar 2012

    Posted 24 Jun in reply to Stefan X1 Link to this post

    Thanks for the sample Stephan, I've tweaked it to be able to reproduce the crash.

    The property grid doesn't correctly show the country initially and clicking the "change item" button will produce the crash. How should I send it to you?

  5. Stefan X1
    Admin
    Stefan X1 avatar
    514 posts

    Posted 29 Jun Link to this post

    Hello Guy,

    Our system does not allow attachments in forum threads, but in support tickets only. You can, however, share how the project which I attached in my previous reply differs from your setup, so I can try finding a possible cause for this issue.

    Regards,
    Stefan X1
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top