This is a migrated thread and some comments may be shown as answers.

Undo in Property Grid

3 Answers 146 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Derrick
Top achievements
Rank 1
Derrick asked on 03 Oct 2012, 08:04 PM
We are currently using the RadPropertyGrid control to display information for different types of Business Objects. We're also using the Command pattern to support undo / redo functionality for certain actions (adding a new Business Object, removing a Business Object, etc.).

What we would like to be able to do is somehow hook our RadPropertyGrid into our Undo/Redo Service. We have considered listening to the PropertyChanged event of the object that is currently being display through the RadPropertyGrid, but wanted to see if anyone else had tackled this problem before, or could point us in the correct direction.

Any help would be greatly appreciated.

Thanks,
Derrick

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 04 Oct 2012, 07:04 AM
Hello Derrick,

Generally, handling PropertyChanged will be the way to go if you want to know when a certain property has been changed and to be able to save the previous value. Another possible way could be to rely on IEditableObject Interface and undo the changes for the whole object. 

Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Derrick
Top achievements
Rank 1
answered on 08 Oct 2012, 07:13 PM
I noticed that in the WinForms version of the RadPropertyGrid there are two events: PropertyValueChanging and PropertyValueChanged.
Is there a reason that these two events are not fired in the WPF version of the Property Grid?

We'd really like to be able to subscribe to these events so that we can use them to handle our undo functionality.

Thanks,
Derrick
0
Vlad
Telerik team
answered on 09 Oct 2012, 05:59 AM
Hello Derrick,

 In WPF the popular pattern is MVVM (unlike WinForms) and you can prepare a special view-model where you can work directly with property setters. 

Regards,
Vlad
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
PropertyGrid
Asked by
Derrick
Top achievements
Rank 1
Answers by
Maya
Telerik team
Derrick
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or