This project has moved. For the latest updates, please go here.

PropertyGrid Reset Value

Apr 9, 2016 at 5:35 PM
Edited Apr 9, 2016 at 5:37 PM
I have looked all over and can not find an example of how to implement the ability to reset a value for an item in the PropertyGrid after it has been changed from the default value. I have tried a number of things but they are all for the WinForms PropertyGrid.

Also I am not sure how to tie this into the AdvancedOptionsMenu. When I set my selected object to a windows control like a button (as you do in your demo) I get the option to reset some properties if they are changed (FontFamily for instance). How does this happen and how can I make it happen for some of my properties? What enables or disables the "Reset Value" option?

I am trying to make a simple setting window. I want to be able to let them select colors for the app to use but I also want them to be able to reset the value on things like colors.
Apr 9, 2016 at 10:59 PM
Just noticed this is broke in the latest release as well. I was using 2.6.0 the demo worked. Now in 2.7.0 the demo is broke when trying to reset the FontFamily on the main PropertyGrid demo showing a button.
Apr 9, 2016 at 11:28 PM
I did some more research and have noticed that the ability to reset changed values on the first PropertyGrid demo for the button only works if you download the live explorer by itself. If you download the source and try to run the live explorer the reset option is not working in any of the past few versions (I only checked the last 3).
Developer
Apr 12, 2016 at 2:09 PM
Hi,

After some testing, it appears that the Reset option is available in the Plus version of the Toolkit, but not in the Community version of the Toolkit. When you download the LiveExplorer, you have a Plus version and that explains why the Reset option works. When you download the source, you have the Community version and that explains why the Reset option is not working.

Issue https://wpftoolkit.codeplex.com/workitem/22239 has been created.
Apr 13, 2016 at 4:58 PM
Thanks for your response. I am a little unclear after reading your issue ticket. Is reset supposed to work for community edition? You said it should in your ticket and that it should not in your post above.

Since my original post I have managed to hack together the ability to reset the properties by setting the tooltip and adding in code to get the default value from the attribute. If anyone needs help on this let me know. I am not sure how this will be the only post about resetting properties. I figured this would have been dealt with many times.

Thanks again
Developer
Apr 13, 2016 at 7:23 PM
Hi,

Yes, the Reset option is available in the Community edition of the Toolkit. The bug with it in the Community edition will be fixed in v3.1.
The Plus edition doesn't have the bug.

Thanks.