Undo in Property Grid

4 posts, 0 answers
  1. Derrick
    Derrick avatar
    3 posts
    Member since:
    Sep 2012

    Posted 03 Oct 2012 Link to this post

    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
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 04 Oct 2012 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Derrick
    Derrick avatar
    3 posts
    Member since:
    Sep 2012

    Posted 08 Oct 2012 Link to this post

    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
  5. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 09 Oct 2012 Link to this post

    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.

Back to Top