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

Set RadWizard To Initial State On RadWindow Opening

0 Answers 80 Views
Wizard
This is a migrated thread and some comments may be shown as answers.
Yusuf
Top achievements
Rank 1
Yusuf asked on 09 Apr 2017, 12:19 PM

In my web application I'm using RadWizard in RadWindow for import personels from excel. So in first step there is a RadAsyncUpload control. When ´ActiveStepIndex==1´ saving excel to server in ´NextButtonClick´ event. And when step index is 2 inserting personels.

 

protected void excelImportWizard_NextButtonClick(object sender, WizardEventArgs e)
{
    if (excelImportWizard.ActiveStepIndex == 1)
    {
        var files = excelImportAsyncUpload.UploadedFiles;
        if (files.Count == 0)
        {
            e.CurrentStep.Active = true;
            CurrentMaster.AlertWindow("Lütfen içeri alınacak verileri içeren dosyayı yükleyiniz.");
            return;
        }
 
        SaveFile(files[0]);
 
        ExcelImportPreviewSpreadsheet.Provider = new SpreadsheetDocumentProvider(LastSavedFilePath);               
    }
 
    if (excelImportWizard.ActiveStepIndex == 2)
    {
        Departments = OperationController.GetDepartments();
        Companies = DefinitionController.GetParentCompaniesFromCompanyType(new List<int> { 2, 3, 4 });
        PersonelProfessions = DefinitionController.GetAllPersonelProfessions();
        PersonelTitles = OperationController.GetPersonelTitles(SessionManager.CurrentUser.ProfileIdentifier);
 
 
        ProcessFile(excelImportAsyncUpload.UploadedFiles[0]);
 
    }
}

 

When importing personels finishes and user clicks finish button of radwizard I'm closing RadWindow from client side in parent window of RadWindow.

protected void excelImportWizard_FinishButtonClick(object sender, WizardEventArgs e)
{         
    RadAjaxManager.GetCurrent(Page).ResponseScripts.Add(@"clearUpload();");
    RadAjaxManager.GetCurrent(Page).ResponseScripts.Add(@"" + CallBackFunctionOnFinish + "();");
}

 

But when I open RadWindow again, I see that RadWizard's active step is still last WizardStep. Because of this I set active step to 0 on finish button click.

excelImportWizard.ActiveStepIndex = 0;

 

After I set active step index to 0 manually I opened radwindow and see wizard waits on first step as I wanted. But when I click next button ActiveStepIndex is still 0, not changed to 1. How do I set RadWizard correctly to the initial state on RadWindow opening.

No answers yet. Maybe you can help?

Tags
Wizard
Asked by
Yusuf
Top achievements
Rank 1
Share this question
or