If the user clicks next, is there a way to cancel the move to the next tab in ActiveStepChange? or even just to set the active step back to the previous step.
2 Answers, 1 is accepted
0
Accepted
Ivan Danchev
Telerik team
answered on 29 May 2015, 03:02 PM
Hello,
Thank you for contacting Telerik Support.
1. The ActiveStepChanged event is a server event and cannot be canceled, however, the ActiveStep can be changed to the previous one as demonstrated in the following code snippet:
int activeStepIndex = (sender as RadWizard).ActiveStep.Index;
(sender as RadWizard).ActiveStepIndex = activeStepIndex - 1;
}
2. Here's how you can cancel the navigation to the next step on the client, when the user clicks on the "Next" button:
function OnClientButtonClicking(sender, args) {
//additional logic/condition for canceling the event
var command = args.get_command();
if (command == "1") {
args.set_cancel(true);
}
}
The buttons are associated with different commands codes and the command for the "Next" button is "1". You can get this data in the OnClientButtonClicking event handler and cancel the event. Additional logic may be added in order to cancel the event only when the user clicks "Next" in a particular step.
I hope this was useful. Feel free to contact us again if you have more questions.