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

RadStrip selecting tab on postback

1 Answer 95 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
celerity12
Top achievements
Rank 1
celerity12 asked on 16 Aug 2013, 06:05 AM
 I have the below radstrip and i am adding the tabs in page load as shown below

<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Visible="false"
OnTabClick="RadTabStrip1_TabClick" AutoPostBack="true" >
</telerik:RadTabStrip>

<telerik:RadGrid ID="RadGrid1" runat="server" Width="100%" AllowPaging="true" AllowSorting="true" AutoGenerateColumns="false" PageSize="2"  

                ShowStatusBar="true" AllowFilteringByColumn="true"  Skin="Sitefinity" OnItemDataBound="RadGrid1_ItemDataBound" Font-Size="9px" >
In Page Load

RadTabStrip1.Tabs.Clear();
RadTabStrip1.Visible = true;
tabExpired = new RadTab();
tabExpired.Text = "Expired";
tabExpiringIn7 = new RadTab();
tabExpiringIn7.Text = "7 Days";
RadTabStrip1.Tabs.Add(tabExpired);
RadTabStrip1.Tabs.Add(tabExpiringIn7);
 
if (!Page.IsPostBack)
{
    qcer = new QReport();
    hideColumnDT(qcer.getColumns());
    dt = qcer.getDT("EXPIRED");
    //tabExpired.Selected = true;
    RadTabStrip1.Tabs[0].Selected = true;
    RadTabStrip1.Tabs[0].BackColor = System.Drawing.Color.Red;
}else{
            //tabExpired.Selected = false;
            RadTabStrip1.Tabs[1].Selected = true;
            RadTabStrip1.Tabs.FindTabByText("7 Days").Selected = true;
            RadTabStrip1.Tabs[1].BackColor = System.Drawing.Color.Red;
 
            qcer = new QReport();
            hideColumnDT(qcer.getColumns());
            dt = qcer.getDT("7 DAYS");
        }
On page load it shows expired tab selected but when doing postback the tab is not changing ....

Even trying to do in the tabClick as below but no luck

protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
        {
           if (e.Tab.Text.Equals("7 Days"))
           {
               RadTabStrip1.Tabs[1].Selected = true;
               RadTabStrip1.Tabs.FindTabByText("7 Days").Selected = true;
               RadTabStrip1.Tabs[1].ForeColor = System.Drawing.Color.Red;
               e.Tab.Selected = true;
               e.Tab.Enabled = true;
               e.Tab.Focus();
            }
}

Please help

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 20 Aug 2013, 01:47 PM
Hi Amit,

I have tested your code on my side and the selected tab is changed to "tabExpiringIn7" tab on postback.

I am attaching a simple project with your scenario that works as expected on my side. Please give it a try and see if it works on your side too.
 

Best Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Ajax
Asked by
celerity12
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or