Objects in DataGrid not firing ListChanged event in BindingList they are in
I have read pretty much all Stackoverflow questio开发者_Go百科ns about DataGrid, BindingList<T>
and ListChanged
and still have no answer.
I have an object called Invoice : INotifyPropertyChanged
, that has a BindingList<InvoiceLine> : INotifyPropertyChanged
that consists of number of InvoiceLine : INotifyPropertyChanged
objects.
Now when in the DataGrid
that is bound to the BindableList<InvoiceLine>
I change one of the properties of a InvoiceLine
a PropertyChanged
event is fired but ListChanged
event is not fired on the BindableList<InvoiceLine>
.
InvoiceLines is initialized like this:
this.InvoiceLines = new BindingList<InvoiceLine>();
this.InvoiceLines.ListChanged += new System.ComponentModel.ListChangedEventHandler(InvoiceLines_ListChanged);
this.InvoiceLines.RaiseListChangedEvents = true;
this.InvoiceLines.AllowEdit = true;
精彩评论