general C# question.

  • Thread starter Thread starter vidalsasoon
  • Start date Start date
V

vidalsasoon

I have a PropertyGrid that takes an instance of an object as a
parameter and displays this objects' field. I would like to have
real-time access to this object (if the object changes then I would
like to see these changes reflected on the PropertyGrid).
suggestions?
 
vidalsasoon,

In order to support this, you need to create an event of type
EventHandler with the name <property name>Changed

Then, in the property setter, after you store the value (or do whatever
you have to do to ensure that getting the value will return the new value),
fire the event.

The property grid will pick up on this.

Hope this helps.
 
Back
Top