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

Accessing Control within Wizard

1 Answer 59 Views
Wizard
This is a migrated thread and some comments may be shown as answers.
olepadre
Top achievements
Rank 1
olepadre asked on 09 Oct 2015, 01:00 PM

I have 6 steps (with 5 sessions of classes and a Review and Submit step), each step has a gridview to list classes available to be taught in corresponding session.  The first column of each gridview is a TemplateField  with a checkbox so individuals can click to register for class.  The boxes are persistent across steps which is nice. When the user gets to the final step, I would like to have another gridview to list the classes they have selected from the previous 5 steps, just as a review before submitting.

I have build a dynamic DataTable to hold the users responses as the cycle through the wizard so I can display the classes they have selected on the last step before clicking finish.

I am having trouble accessing the checkbox in the gridview in each step.  Not sure which event to use and if I have to FindControl the gridview first then the checkbox, etc.

 

I tried using the NextButtonClick event, and SELECT CASE the RadWizard.ActiveStepIndex to determine what step they are on then using the following but to no avail.

 

Protected Sub RadWizardNextButtonClick(sender As Object, e As Telerik.Web.UI.WizardEventArgs) Handles radWizard.NextButtonClick
Select Case radWizard.ActiveStepIndex
Case 0
For Each item As GridViewRow In GridView1.Rows
Dim chk As CheckBox = DirectCast(item.FindControl("CheckBox1"), CheckBox)
If chk IsNot Nothing Then
Session1 = item.Cells(1).Text
End If
Next
Case 2
For Each item As GridViewRow In GridView2.Rows
Dim chk As CheckBox = DirectCast(item.FindControl("CheckBox1"), CheckBox)
If chk IsNot Nothing Then
Session2 = item.Cells(1).Text
End If
Next
Case 3
For Each item As GridViewRow In GridView3.Rows
Dim chk As CheckBox = DirectCast(item.FindControl("CheckBox1"), CheckBox)
If chk IsNot Nothing Then
Session3 = item.Cells(1).Text
End If
Next
Case 4......

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 14 Oct 2015, 07:35 AM
Hi,

The Wizard Control keeps the controls one the same level so you don't need to use find control to reach the controls between steps. 

Hope this information will be helpful.

Regards,
Plamen
Telerik
Tags
Wizard
Asked by
olepadre
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or