Home Forums WPF controls Xceed DataGrid for WPF V1.3 System.Reflection.TargetException when adding new row

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #25365 |

    V1.3 is raising ‘System.Reflection.TargetException: Object does not match target type.’ when comitting a new row in the grid – i.e. pressing Return after add data into the InsertionRow. I’ve uninstalled v1.3 and reinstalled v1.2 (3.1.7467) and it all works perfectly. Reinstalled v1.3 again and I get the TargetException so I know it is something introduced in v1.3.

    My data source uses BindingList<> – (e.g. Notes : BindingList<Note>). I’ve tried with DataGridCollectionViewSource and CollectionViewSource and with AutoCreateColumns both True and False. When True, I’ve also tried removing all but a single text column but I still get the exception.

    — Michael

    Stack trace follows:-

    Exception Info:
    —————
    System.Reflection.TargetException: Object does not match target type.
    at System.Reflection.RuntimeMethodInfo.CheckConsistency(Object target)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
    at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
    at System.ComponentModel.ReflectEventDescriptor.AddEventHandler(Object component, Delegate value)
    at System.ComponentModel.ReflectPropertyDescriptor.AddValueChanged(Object component, EventHandler handler)
    at MS.Internal.Data.ValueChangedEventManager.ValueChangedRecord..ctor(ValueChangedEventManager manager, Object source, PropertyDescriptor pd)
    at MS.Internal.Data.ValueChangedEventManager.PrivateAddListener(Object source, IWeakEventListener listener, PropertyDescriptor pd)
    at MS.Internal.Data.PropertyPathWorker.ReplaceItem(Int32 k, Object newO, Object parent)
    at MS.Internal.Data.PropertyPathWorker.UpdateSourceValueState(Int32 k, ICollectionView collectionView, Object newValue, Boolean isASubPropertyChange)
    at MS.Internal.Data.ClrBindingWorker.AttachDataItem()
    at System.Windows.Data.BindingExpression.Activate(Object item)
    at System.Windows.Data.BindingExpression.OnDataContextChanged(DependencyObject contextElement)
    at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
    at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
    at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)
    at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
    at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
    at System.Windows.TreeWalkHelper.OnInheritablePropertyChanged(DependencyObject d, InheritablePropertyChangeInfo info)
    at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d)
    at System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe)
    at System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d)
    at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
    at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
    at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
    at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d)
    at System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe)
    at System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d)
    at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
    at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
    at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
    at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d)
    at System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe)
    at System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d)
    at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
    at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
    at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
    at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d)
    at System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe)
    at System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d)
    at System.Windows.DescendentsWalker`1.WalkLogicalChildren(FrameworkElement feParent, FrameworkContentElement fceParent, IEnumerator logicalChildren)
    at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
    at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
    at System.Windows.DescendentsWalker`1._VisitNode(DependencyObject d)
    at System.Windows.DescendentsWalker`1.VisitNode(FrameworkElement fe)
    at System.Windows.DescendentsWalker`1.VisitNode(DependencyObject d)
    at System.Windows.DescendentsWalker`1.WalkFrameworkElementLogicalThenVisualChildren(FrameworkElement feParent, Boolean hasLogicalChildren)
    at System.Windows.DescendentsWalker`1.IterateChildren(DependencyObject d)
    at System.Windows.DescendentsWalker`1.StartWalk(DependencyObject startNode, Boolean skipStartNode)
    at System.Windows.TreeWalkHelper.InvalidateOnInheritablePropertyChange(FrameworkElement fe, FrameworkContentElement fce, InheritablePropertyChangeInfo info, Boolean skipStartNode)
    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, OperationType operationType)
    at System.Windows.DependencyObject.ClearValueCommon(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata)
    at System.Windows.DependencyObject.ClearValue(DependencyProperty dp)
    at Xceed.Wpf.DataGrid.InsertionRow.ClearDataContext()
    at Xceed.Wpf.DataGrid.InsertionRow.CancelEdit()
    at Xceed.Wpf.DataGrid.InsertionRow.EndEdit()
    at Xceed.Wpf.DataGrid.DataGridControl.OnPreviewMouseDown(MouseButtonEventArgs e)
    at System.Windows.UIElement.OnPreviewM

    Imported from legacy forums. Posted by Michael (had 6585 views)

    Xceed Support
    Member
    Post count: 5658

    Hi, just wanted to inform you that I have filed a bug report for this.

    We will update this thread whenever we have information concerning this issue.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 529 views)

    Xceed Support
    Member
    Post count: 5658

    Could you send me a repro app to belandj@xceedsoft.com?

    Imported from legacy forums. Posted by Jenny [Xceed] (had 419 views)

    User (Old forums)
    Member
    Post count: 23064

    I’m getting the same exception in both 1.3 and 1.2.

    My BindingList<T> wraps an EntitySet gened by LINQ to SQL.

    Alex.

    Imported from legacy forums. Posted by Alex (had 721 views)

    Xceed Support
    Member
    Post count: 5658

    If either of you can send me a repro app, I will be able to investigate further.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 628 views)

    User (Old forums)
    Member
    Post count: 23064

    I’ve just sent you a repro app.

    Regards
    Michael

    Imported from legacy forums. Posted by Michael (had 611 views)

    Xceed Support
    Member
    Post count: 5658

    Hi Michael,

    Thanks for the repro. I have assigned it to one of the developers so that they can take a look at the problem. For the moment, I do not have a solution to offer other than to continue using 1.2.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 407 views)

    User (Old forums)
    Member
    Post count: 23064

    Can you let us know if you can release another quick patch to resolve this problem? It deterred us from going to 1.3

    Imported from legacy forums. Posted by nat (had 662 views)

    Xceed Support
    Member
    Post count: 5658

    Just to let you know we are currently investigating the problem.

    We will update this thread whenever we have new information concerning the issue.

    Imported from legacy forums. Posted by Chris [Xceed] (had 735 views)

    Xceed Support
    Member
    Post count: 5658

    This is finally a bug in the the InsertionRow class.

    The InsertionCell’s Contents is Bound to its ParentRow’s DataContext. When the EndEdit is called on the InsertionRow, at some time we cleared the InsertionRow’s DataContext (using DependencyObject.ClearValue()) BEFORE clearing the InsertionCell’s Content which seems to try to resolve some Bindings to the old value, causing the TargetException

    This should be included in the Next Service Release. We will notify you when it’s available.

    Thanks for reporting this issue

    Imported from legacy forums. Posted by Chris [Xceed] (had 743 views)

    Xceed Support
    Member
    Post count: 5658

    The fix for this issue is available through our <a href=”http://download3.xceedsoft.com/Packages/3.2.7570.10530/XceedComponents.exe”>latest package</a>.

    Imported from legacy forums. Posted by CharlesB (had 9493 views)

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.