Accessing Control within Wizard

2 posts, 0 answers
  1. olepadre
    olepadre avatar
    8 posts
    Member since:
    Apr 2007

    Posted 09 Oct 2015 Link to this post

    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......

  2. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 14 Oct 2015 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top