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

Undo a drag/drop

1 Answer 50 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 01 Feb 2013, 06:01 PM
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

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 06 Feb 2013, 02:10 PM
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.
Tags
PageView
Asked by
Andy
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or