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

Validation on each page

3 Answers 113 Views
Wizard
This is a migrated thread and some comments may be shown as answers.
MrSzymonello
Top achievements
Rank 1
MrSzymonello asked on 08 Dec 2016, 04:48 PM

Hello

Could guide how to validate each page of the RadWizard control? Ideally it would be to validate current page when the Next button is clicked. Then in case of errors on the page move to the next page would be cancelled.

Best regards

Szymon

3 Answers, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 13 Dec 2016, 11:42 AM
Hello Szymon,

What you can do in such scenario is to handle RadWizard's SelectionChanging event and based on your validation logic, cancel the selection. Here's what I have in mind:

private void radWizard_SelectionChanging(object sender, SelectedPageChangingEventArgs e)
{
    if (e.OldPage != null && e.OldPage.Content.ToString().Contains("Second"))
    {
        e.Cancel = true;
    }
}

Please let me know if this would work for you.

Regards,
Dilyan Traykov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
MrSzymonello
Top achievements
Rank 1
answered on 14 Dec 2016, 09:17 AM
Yeah, it works for me! However I named each WizardPage in my xaml and in the radWizard_SelectionChanging I use Name property to distinguish between pages.
0
Dilyan Traykov
Telerik team
answered on 14 Dec 2016, 04:12 PM
Hello Szymon,

I'm glad to hear that the suggested approach works for you. If I can further assist you in any way, please let me know.

Regards,
Dilyan Traykov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Wizard
Asked by
MrSzymonello
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
MrSzymonello
Top achievements
Rank 1
Share this question
or