我已经阅读了几乎所有关于 Stackoverflow 的问题DataGrid, BindingList<T>,ListChanged但仍然没有答案。
我有一个名为 的对象Invoice : INotifyPropertyChanged,它有一个BindingList<InvoiceLine> : INotifyPropertyChanged由多个对象组成的InvoiceLine : INotifyPropertyChanged对象。
现在,当在DataGrid绑定到的时,我更改了一个事件BindableList<InvoiceLine>的属性之一,但事件没有在.InvoiceLinePropertyChangedListChangedBindableList<InvoiceLine>
InvoiceLines 的初始化如下:
this.InvoiceLines = new BindingList<InvoiceLine>();
this.InvoiceLines.ListChanged += new System.ComponentModel.ListChangedEventHandler(InvoiceLines_ListChanged);
this.InvoiceLines.RaiseListChangedEvents = true;
this.InvoiceLines.AllowEdit = true;