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

obtain a control value

1 Answer 107 Views
Wizard
This is a migrated thread and some comments may be shown as answers.
gonzalez
Top achievements
Rank 1
Veteran
gonzalez asked on 22 Jun 2015, 08:25 PM

when I create a dynamically control within RadWizard, for example:

// Code Behind

Label mylabel = new Label ();             

myetiqueta.ID = "lbl" + step.UniqueID; // step is a variable type RadWizardStep             

etiqueta.Text = "Any Value"             

step.Controls.Add (label); // Add control

if I want to access control in the code behind, for example

RadWizard.WizardSteps [0] .Controls [0];
I do not have access to control, is there any solution?

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 23 Jun 2015, 07:21 AM
Hello,

The added control doesn't have to be the first in the collection so we would rather recommend using FindControl.Here is the code that worked correctly at my side:
protected void Page_Load(object sender, EventArgs e)
   {
       Label mylabel = new Label ();            
           mylabel .ID = "lbl" ; // step is a variable type RadWizardStep            
           mylabel.Text = "Any Value";        
           RadWizardStep1.Controls.Add (mylabel); // Add control
           Response.Write(((Label)RadWizard6.WizardSteps[0].FindControl("lbl")).Text);
   }

Hope this will help you solve the issue.

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