New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial
Server-side Programming Overview
You can configure the settings of RadStepper and create its Steps in the code-behind via the Server-Side API of the control.
RadStepper Public Properties and Methods
For a list with the server-side properties and methods of the control, see the Server-Side API of the RadStepper class. You can also find it in the IntelliSense in Visual Studio.
Create a RadStepper in the Code-behind:
ASP.NET
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
C#
protected void Page_Init(object sender, EventArgs e)
{
var stepper = new RadStepper();
stepper.ID = "RadStepper1";
stepper.Skin = "Silk";
stepper.Linear = false;
stepper.Orientation = StepperOrientation.Vertical;
stepper.DataBinding += new EventHandler(RadStepper1_DataBinding);
stepper.Load += new EventHandler(RadStepper1_Load);
PlaceHolder1.Controls.Add(stepper);
}
protected void RadStepper1_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
(sender as RadStepper).DataBind();
}
}
protected void RadStepper1_DataBinding(object sender, EventArgs e)
{
var stepper = (sender as RadStepper);
stepper.Steps.AddRange(GetStepperSteps(null));
}
private IEnumerable<StepperStep> GetStepperSteps(object dataSource)
{
var result = new List<StepperStep>();
result.Add(new StepperStep() { Label = "Home", Icon = "home", Error = true });
result.Add(new StepperStep() { Label = "Settings", Icon = "gear", Enabled = false });
result.Add(new StepperStep() { Label = "Attachments", Icon = "attachment", Selected = true });
result.Add(new StepperStep() { Label = "Save", Icon = "save" });
return result;
}