Customizing Text Value for a Group CMFCPropertyGridProperty

  • Thread starter Thread starter smj_w
  • Start date Start date
S

smj_w

Guest
I have a group CMFCPropertyGridProperty property. Its sub-properties are all simple boolean properties with names like "Option A", "Option B", etc. The values for those Sub-properties are all "true" or "false".

I would like to customize the text Value for the Group property such that instead of it saying "true, true, false, true", etc., it instead lists the options which are true. In this example it would have the text "A, B, D".

To that end I created a class derived from CMFCPropertyGridProperty and overrode the virtual function "FormatProperty()". It successfully causes the Group Property value to be set to the required text.

However, when I click on that value, it gets screwy. The "OnUpdateValue()" virtual function for the group property is called, and it tries to compare the string value "A, B, D" with the values in the sub-properties (which are "true", "false" etc.) - obviously finds a mismatch, and updates the values of those sub-properties, which in turn updates the value of the group property to some incorrect value. This all happens even with the Group Property set to AllowEdit(false).

So my question is - how can I do what I want? Successfully customize the text value for a Group property without the problem descibed above?

Thanks,
--Steve

Continue reading...
 
Back
Top