Search code examples
visual-c++mfccmfcpropertygridctrl

CMFCPropertyGridCtrl add editable string property


I derived a class from CMFCPropertyGridCtrl to add a simple interface for my needs. I want to add a new string value so I can edit it:

void CPropertyGrid::AddString(const char* tag, const char* defaultValue)
{
    COleVariant valueType(defaultValue);
    CMFCPropertyGridProperty *stringProperty = new CMFCPropertyGridProperty(tag, valueType);
    stringProperty->AllowEdit(TRUE);
    AddProperty(stringProperty);
}

This adds a new string in the property grid, but I can't edit it. Is there another way to make this editable?

Thanks!


Solution

  • Notify value must be set to true to be able to edit values.


    Screen shot:

    enter image description here