Undo a drag/drop

2 posts, 0 answers
  1. Andy
    Andy avatar
    7 posts
    Member since:
    Oct 2012

    Posted 01 Feb 2013 Link to this post

    What is the best way to undo a drag/drop of a pageviewPage? I have some business rules that need to be enforced either before,during, or after a user tries to rearrange the tabs.

    Thanks
  2. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 06 Feb 2013 Link to this post

    Hi Andy,

    Thank you for contacting us.

    RadPageView does not support undo/redo operations out of the box and you have to implement this functionality on your own. For example, you can subscribe for PageIndexChanged event and add there a logic for the undo operation. Please refer to the code snippet below:

    void radPageView1_PageIndexChanged(object sender, RadPageViewIndexChangedEventArgs e)
    {
        AddUndoOperation(new PageViewOperation(OperationType.IndexChange, e.NewIndex, e.OldIndex));
    }

    For further details, consider the this article which describes the memento pattern.

    If you have other questions, do not hesitate to ask.

    Regards,
    Peter
    the Telerik team
    Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top