I have a user control that generates a series of arrow buttons. I want each button to display a user control. My custom arrow button navigation looks like this:
When the button is clicked, the user control below the arrows will be displayed. Each arrow button must be associated with a user control containing unique functions specific to that button. I currently have a simple property List<ArrowTab> Tabs { get; set; }
List<ArrowTab> Tabs { get; set; }
List<ArrowTab> Tabs { get; set; }
in the user control, and in the page_load of the page where the user control is placed, I add some example tabs (see above) programmatically, for example:
TabWizard1.Tabs = new List<ArrowTab> { new ArrowTab { Text = "Project Settings", Selected = true }, new ArrowTab { Text = "Groups" }, new ArrowTab { Text = "Products" }, new ArrowTab { Text = "Make Assignments" }, new ArrowTab { Text = "Review Assignments" }, new ArrowTab { Text = "Commitments" } };
This works to add a button from the code behind, but I really want to add the button to the markup for the user control on the page, and also associate another user setting with it. For example, I want to do something like this:
<uc:TabWizard ID="TabWizard1" runat="server"> <items> <arrowTab Text="Project Settings"> <uc:ProjectSettingsControl ID="projectSettings1" runat="server" /> </arrowTab> <arrowTab Text="Groups"> <uc:GroupsControl ID="groups1" runat="server" /> </arrowTab> <arrowTab Text="Products"> <uc:ProductsControl ID="products1" runat="server" /> </arrowTab> <arrowTab Text="Make Assignments"> <uc:MakeAssignmentsControl ID="makeAssignments1" runat="server" /> </arrowTab> <arrowTab Text="Review Assignments"> <uc:ReviewAssignmentsControl ID="reviewAssignments1" runat="server" /> </arrowTab> <arrowTab Text="Commitments"> <uc:CommitmentsControl ID="commitments1" runat="server" /> </arrowTab> </items> </uc:TabWizard>
An example of someone already doing something similar is the Telerik RadPanel control.
<telerik:RadPanelItem Text="Mail" ImageUrl="Img/mail.gif" Expanded="True"> <Items> <telerik:RadPanelItem ImageUrl="Img/mailPersonalFolders.gif" Text="Personal Folders" /> <telerik:RadPanelItem ImageUrl="Img/mailDeletedItems.gif" Text="Deleted Items" /> <telerik:RadPanelItem ImageUrl="Img/mailInbox.gif" Text="Inbox" /> <telerik:RadPanelItem ImageUrl="Img/mailFolder.gif" Text="My Mail" /> <telerik:RadPanelItem ImageUrl="Img/mailSent.gif" Text="Sent Items" /> <telerik:RadPanelItem ImageUrl="Img/mailOutbox.gif" Text="Outbox" /> <telerik:RadPanelItem ImageUrl="Img/mailSearch.gif" Text="Search Folders" /> </Items> </telerik:RadPanelItem>
I have no idea how to create a user control that allows this behavior. Even just pushing in the right direction would be helpful.
source share