Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BindingList.ListChanged Event not Raised when Property Changes

Tags:

c#

bindinglist

I have a BindingList of type User, the User object has several properties (UserName, Password, etc). So I tied an event handler to the BindingList.ListChanged event, and it works fine when adding or deleting a user, BUT, if a user property changes, it does not raise the event, is there any way to achieve this?

bindingListUsers.Add(someUser); // This raises ListChangedEvent

bindingListUsers.Delete(someUser); // This raises ListChangedEvent

bindingListUsers[0].UserName = "Another user name"; // This does NOT raise the event
like image 292
Carlo Avatar asked Dec 30 '22 00:12

Carlo


1 Answers

Your User type need to implement INotifyPropertyChanged.

like image 56
leppie Avatar answered Jan 08 '23 02:01

leppie