diff --git a/include/wx/propgrid/propgridiface.h b/include/wx/propgrid/propgridiface.h index a553d6dba1..542f60b795 100644 --- a/include/wx/propgrid/propgridiface.h +++ b/include/wx/propgrid/propgridiface.h @@ -1070,14 +1070,7 @@ public: */ void SetPropertyReadOnly( wxPGPropArg id, bool set = true, - int flags = wxPG_RECURSE ) - { - wxPG_PROP_ARG_CALL_PROLOG() - if ( flags & wxPG_RECURSE ) - p->SetFlagRecursively(wxPG_PROP_READONLY, set); - else - p->ChangeFlag(wxPG_PROP_READONLY, set); - } + int flags = wxPG_RECURSE ); /** Sets property's value to unspecified. If it has children (it may be category), then the same thing is done to diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index 5605f7a7ce..e6082b7765 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -283,6 +283,24 @@ bool wxPropertyGridInterface::EnableProperty( wxPGPropArg id, bool enable ) return true; } +void wxPropertyGridInterface::SetPropertyReadOnly( wxPGPropArg id, bool set, int flags) +{ + wxPG_PROP_ARG_CALL_PROLOG() + + if ( flags & wxPG_RECURSE ) + p->SetFlagRecursively(wxPG_PROP_READONLY, set); + else + p->ChangeFlag(wxPG_PROP_READONLY, set); + + wxPropertyGridPageState* state = p->GetParentState(); + if( state ) + { + // If property is attached to the property grid + // then refresh the view. + RefreshProperty( p ); + } +} + // ----------------------------------------------------------------------- bool wxPropertyGridInterface::ExpandAll( bool doExpand )