Validation on each page

4 posts, 0 answers
  1. MrSzymonello
    MrSzymonello avatar
    4 posts
    Member since:
    Jun 2016

    Posted 08 Dec 2016 Link to this post

    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

  2. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    603 posts

    Posted 13 Dec 2016 Link to this post

    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.
  3. MrSzymonello
    MrSzymonello avatar
    4 posts
    Member since:
    Jun 2016

    Posted 14 Dec 2016 Link to this post

    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.
  4. Dilyan Traykov
    Admin
    Dilyan Traykov avatar
    603 posts

    Posted 14 Dec 2016 Link to this post

    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.
Back to Top