asp.net wizard control sidebar template customization

Question: How to change sidebar template of the wizard control so that only previous wizard steps would be enabled?
Answer:Create something like this in your *.aspx file:

And create something like this in your *.aspx.cs file:
[code lang=”cpp”]
protected void SideBarList_ItemDataBound(object sender, DataListItemEventArgs e)
{
WizardStep dataItem = e.Item.DataItem as WizardStep;
LinkButton linkButton = e.Item.FindControl(“SideBarButton”) as LinkButton;
if (dataItem != null)
{
//If active step index less than item index lets disable the link
if (dataItem.Wizard.ActiveStepIndex < e.Item.ItemIndex)
{
linkButton.Enabled = false;
}
//If active step index equals to item index lets remove underline
if (dataItem.Wizard.ActiveStepIndex == e.Item.ItemIndex)
{
linkButton.Style.Add(HtmlTextWriterStyle.TextDecoration, “none”);
}
}
}[/code]

https://i0.wp.com/are.ehibou.com/wp-content/plugins/downloads-manager/img/icons/default.gif?w=625 download: WizardWithCustomSideBar.zip ()
added: 28/07/2010
clicks: 465
description: Wizard With Custom Side Bar

7 thoughts on “asp.net wizard control sidebar template customization

Leave a Reply