PropertyGrid and INotifyPropertyChanged problem

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

Hi,

I've got a problem with the PropertyGrid and the
INotifyPropertyChanged interface. I have a class that implements the
INotifyPropertyChanged and raises the PropertyChanged when a property
of this class is changed. My PropertyGrid is connected to this object
through the SelectedObject property.

My problem is that the PropertyGrid does not get updated when the
object's property value is changed. I can see that the
INotifyPropertyChanged.PropertyChanged is null which means that the
PropertyGrid is not attached to this event.

How can I make the PropertyGrid listen to
INotifyPropertyChanged.PropertyChanged events?

Best regards,
Chris
 
Hi Nicolas,

thanks for your posting.

Linda's solution seems to work, but only if there are other bindings
active. If the PropertyGrid and the DemoCustomer are the only citizens
on a Form, the PropertyGrid update still doesn't work when a
DemoCustomer property is modified. But if you add additional databound
controls to the form that are bound to any property of the
DemoCustomer object, also the PropertyGrid is getting updated. Very
strange behaviour.

Best regards,
Chris
 
Back
Top