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

Tabs Based on Date Passed in QueryString

1 Answer 42 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 23 Nov 2011, 05:21 PM
I'm interested in building a tab strip that will dynamically change based on a value passed in a querystring, such as a date.
The current date will be highlighted in the tab and multiple days on either side of the center tab will show.
I've attached a screen shot of what I'd like to do and I didn't know if there's a similar example out there.

Thanks,
Matt

1 Answer, 1 is accepted

Sort by
0
Matt
Top achievements
Rank 1
answered on 25 Nov 2011, 07:23 PM
No need to reply to this.  I was able to come up with something.  
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="Outlook">
    </telerik:RadTabStrip>
System.DateTime StartDate = Convert.ToDateTime(Request.QueryString["StartDate"]);
                for (int i = -5; i < 6; i++)
                {
                    RadTab rootTab = new RadTab();
                    RadTabStrip1.Tabs.Add(rootTab);
                    rootTab.Text = String.Format("{0:MMM}", StartDate.AddDays(i)).ToString() +"<BR /><strong>"
                        +String.Format("{0:dd}", StartDate.AddDays(i)).ToString()+"</strong><BR/ >"
                        +String.Format("{0:ddd}", StartDate.AddDays(i)).ToString();
                }
            RadTabStrip1.SelectedIndex = 5;
Tags
TabStrip
Asked by
Matt
Top achievements
Rank 1
Answers by
Matt
Top achievements
Rank 1
Share this question
or