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

Loading/Saving/Loading Next each step

1 Answer 162 Views
Wizard
This is a migrated thread and some comments may be shown as answers.
Kurt Kluth
Top achievements
Rank 1
Kurt Kluth asked on 25 Apr 2019, 01:38 PM

I have a wizard that will step users through an application and we allow users to leave the application process and return later.  We obviously don't want them to lose any progress they made previously so we store the data in the database.  What I am looking to do is if data exists for step 1, load it, Save data on clicking "Next", then load step 2 (if data exists), save on "Next", etc.. through the process.  I have the code to save the data but not sure of what RadWizard Function I should be referencing to load current step data.  Here is what I have for when they click "Next"

Private Sub RadWizard1_ActiveStepChanged(sender As Object, e As EventArgs) Handles RadWizard1.ActiveStepChanged
    Dim activeStepIndex As Integer = TryCast(sender, RadWizard).ActiveStep.Index
    If activeStepIndex = 1 Then
        SaveStep1()
    ElseIf activeStepIndex = 2 Then
        SaveStep2()
    ElseIf activeStepIndex = 3 Then
        'UploadFiles()
    End If
 
End Sub

1 Answer, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 30 Apr 2019, 10:31 AM
Hello Kurt,

In the OnActiveStepChanged event, the RadWizard is already having the new step as the current step, so if the index(which is zero based) is 1, you should save the first step and load the second one. 

Keep in mind that if the Navigation bar is active, this event will be fired when clicking also the Previous button or when clicking on the navigation bar items. If you need to know which is the previous step, I can recommend saving it's index or ID in the session and change it in the ActiveStepChanged. 

Otherwise, you can use the following events that are fired when the buttons are clicked: 
Regards,
Peter Milchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Wizard
Asked by
Kurt Kluth
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Share this question
or