Link to home
Start Free TrialLog in
Avatar of Russ Suter
Russ Suter

asked on

Responding to a property change event

I tried following this example (http://stackoverflow.com/questions/2246777/raise-an-event-whenever-a-propertys-value-changed) but nothing fired so I just decided to implement the PropertyValueChanged event of the PropertyGrid control. That works but what I need to do is get the actual instance and property of the class that is being affected. Anyone know how I can do this via the event implementation?

        void propertyGrid1_PropertyValueChanged(object s, System.Windows.Forms.PropertyValueChangedEventArgs e)
        {
            // What do I put here to get the instance of the bound object and the property being changed?
        }

Open in new window

Avatar of themrrobert
themrrobert
Flag of United States of America image

e.ChangedItem is the GridItem that was changed.
e.OldValue is the oldvalue
e.ChangedItem.value is the new value
Avatar of Russ Suter
Russ Suter

ASKER

I don't want the GridItem. I want the object that represents the actual property of the underlying class.
SOLUTION
Avatar of themrrobert
themrrobert
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial