This error is new in the 1.9 release.
If the ```SelectedObject``` is modified outside the PropertyGrid or due to properties with side effects, the displayed properties cannot be refreshed anymore via ```PropertyGrid.Update()```. The getter of the properties is not called anymore. I just had a quick look into the changes from 1.8 to 1.9, but these are significant. I assume this due to the new inner proxy objects.
The ```BindingOperations.GetBindingExpressionBase(prop, PropertyItem.ValueProperty).UpdateTarget();``` call does not work anymore. By the way: if you use ```UpdateSource()``` instead of ```UpdateTarget``` it still overwrites the actual ```SelectedObject```'s property (setter is called with the editor's value).
__Additional feature request while fixing the issue__
It would be nice if ```Update()``` worked recursively so that extended properties are also correctly updated. With the old implementation I used the following solution:
```
private static void UpdateAllHelper(PropertyItemCollection properties)
{
foreach (var prop in properties)
{
BindingOperations.GetBindingExpressionBase(prop, PropertyItem.ValueProperty).UpdateTarget();
if (prop.IsExpandable)
{
UpdateAllHelper(prop.Properties);
}
}
}
public void Update()
{
UpdateAllHelper(Properties);
}
```
The recursion should not be a problem with the default max property depth. But of course, as stated above, the ```UpdateTarget()``` call is not working anymore.
Comments: ** Comment from web user: daageu **
If the ```SelectedObject``` is modified outside the PropertyGrid or due to properties with side effects, the displayed properties cannot be refreshed anymore via ```PropertyGrid.Update()```. The getter of the properties is not called anymore. I just had a quick look into the changes from 1.8 to 1.9, but these are significant. I assume this due to the new inner proxy objects.
The ```BindingOperations.GetBindingExpressionBase(prop, PropertyItem.ValueProperty).UpdateTarget();``` call does not work anymore. By the way: if you use ```UpdateSource()``` instead of ```UpdateTarget``` it still overwrites the actual ```SelectedObject```'s property (setter is called with the editor's value).
__Additional feature request while fixing the issue__
It would be nice if ```Update()``` worked recursively so that extended properties are also correctly updated. With the old implementation I used the following solution:
```
private static void UpdateAllHelper(PropertyItemCollection properties)
{
foreach (var prop in properties)
{
BindingOperations.GetBindingExpressionBase(prop, PropertyItem.ValueProperty).UpdateTarget();
if (prop.IsExpandable)
{
UpdateAllHelper(prop.Properties);
}
}
}
public void Update()
{
UpdateAllHelper(Properties);
}
```
The recursion should not be a problem with the default max property depth. But of course, as stated above, the ```UpdateTarget()``` call is not working anymore.
Comments: ** Comment from web user: daageu **
When is v2.0 is going to be released? Any idea?