Rad Tab Strip maintain values of the control on tab change

2 posts, 0 answers
  1. Vijay
    Vijay avatar
    1 posts
    Member since:
    Dec 2013

    Posted 06 Dec 2013 Link to this post

    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



        
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Dec 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top