Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force CMFCPropertyGridCtrl to refresh after adding an item?

I add an item to the CMFCPropertyGridCtrl, but the new item does not show up only if i click the CMFCPropertyGridCtrl.

Now i have a indirect solution to show up the new item by calling ExpandAll(), but i don't want to expand those i have collapsed.

Is there a way to show up the new item gracefully ?

like image 291
J.Doe Avatar asked Oct 27 '25 10:10

J.Doe


1 Answers

After CMFCPropertyGridProperty.AddSubItem() call, new item will show up by the following two calls:

YourGridCtrl.AdjustLayout();
YourGridCtrl.RedrawWindow();

Hope it helps !

like image 155
kissLife Avatar answered Oct 29 '25 08:10

kissLife



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!