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

Rad Tab Strip maintain values of the control on tab change

1 Answer 74 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Vijay
Top achievements
Rank 1
Vijay asked on 06 Dec 2013, 06:49 AM
Hi team,

              I am using rad tab strip(with three tabs) with control(say radgrid,comboobox,etc.,) when i switch tabs once the controls have been loaded they seem to reload when i switch back to a previous selected tab. How to maintain the previous values in the tab once i switch back to the previous tab.

Thanks,
Vijay



    

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 06 Dec 2013, 09:34 AM
Hi Vijay,

Please have a look into the sample code snippet which works fine at my end.

ASPX:
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
    OnTabClick="RadTabStrip1_TabClick1">
    <Tabs>
        <telerik:RadTab Text="Tab1" runat="server" PageViewID="RadPageView1">
        </telerik:RadTab>
        <telerik:RadTab Text="Tab2" runat="server" PageViewID="RadPageView2">
        </telerik:RadTab>
        <telerik:RadTab Text="Tab3" runat="server" PageViewID="RadPageView3">
        </telerik:RadTab>
    </Tabs>
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server">
    <telerik:RadPageView ID="RadPageView1" runat="server">
        <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server">
        </telerik:RadNumericTextBox>
    </telerik:RadPageView>
    <telerik:RadPageView ID="RadPageView2" runat="server">
        <telerik:RadComboBox ID="RadCombobox1" runat="server">
            <Items>
                <telerik:RadComboBoxItem Text="Combo1" runat="server" />
                <telerik:RadComboBoxItem Text="Combo2" runat="server" />
                <telerik:RadComboBoxItem Text="Combo3" runat="server" />
            </Items>
        </telerik:RadComboBox>
    </telerik:RadPageView>
    <telerik:RadPageView ID="RadPageView3" runat="server">
        <telerik:RadTextBox ID="RadTextBox1" runat="server">
        </telerik:RadTextBox>
    </telerik:RadPageView>
</telerik:RadMultiPage>

C#:
protected void RadTabStrip1_TabClick1(object sender, RadTabStripEventArgs e)
{
    if (e.Tab.Text == "Tab2")
    {
        RadPageView pageview = (RadPageView)this.FindControl("RadPageView1");
        RadNumericTextBox number = (RadNumericTextBox)pageview.FindControl("RadNumericTextBox1");
        string numberdata = number.Text;
    }
    else if (e.Tab.Text == "Tab3")
    {
        RadPageView pageview = (RadPageView)this.FindControl("RadPageView2");
        RadComboBox combo = (RadComboBox)pageview.FindControl("RadComboBox1");
        string selecteditem = combo.SelectedItem.Text;
    }
    else
    {
        RadPageView pageview = (RadPageView)this.FindControl("RadPageView3");
        RadTextBox textbox = (RadTextBox)pageview.FindControl("RadTextBox1");
        string textdata = textbox.Text;
    }
}

Thanks,
Shinu.
Tags
TabStrip
Asked by
Vijay
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or