In RadTabStrip Control Unable Navigate the Tabs by button click event

2 posts, 0 answers
  1. Kaleswar
    Kaleswar avatar
    10 posts
    Member since:
    Jul 2012

    Posted 27 Feb 2014 Link to this post

    I am using RadTabstrip Control in my Sharepoint Project. In my page i have RadMultiPage control in that i have 5 tabs for them i am using 5 RadPageView in each Radpageview i place the user controls each control  have some forms in that i have button controls. These button controls i am using for data insertion as well as navigate the control from one page to another page here i am unable to get that functionality here is my code please look at it. what is the problem in my code

    my.ascx code
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" Skin="Silk">
        <Tabs>
            <telerik:RadTab runat="server" Text="Case Details" ToolTip="Case Details">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Party Details" ToolTip="Party Details">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Legal Practitioner Details" ToolTip="Legal Practitioner Details"></telerik:RadTab>
            <telerik:RadTab runat="server" Text="Document Details" ToolTip="Document Details"></telerik:RadTab>
            <telerik:RadTab runat="server" Text="Summary" ToolTip="Summary"></telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server">
        <telerik:RadPageView ID="RadPageView1" runat="server">
           <UC:CaseInfo ID="CaseDetailsControl" runat="server" />
        </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView2" runat="server" Width="100%">
            <UC:PartyInfo ID="PartyInfoControl" runat="server" />
        </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView3" runat="server" Width="100%">
           <UC:LegalPractitionerDetails ID="LegalPractitionerControl" runat="server" />
         </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView4" runat="server" Width="100%">
        <UC:UploadDocuments ID="UploadDocumentsControl" runat="server" />
        </telerik:RadPageView>
        <telerik:RadPageView ID="RadPageView5" runat="server" Width="100%">
         <UC:CaseSummary ID="CaseSummaryControl" runat="server" />
        </telerik:RadPageView>
    </telerik:RadMultiPage>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"
        Transparency="1">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                <UpdatedControls>
                   
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnCaseInfoNext">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnPartyInfoNext">
                <UpdatedControls>
                 
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnLpNext">
                <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnUploadDocumentsNext">
                <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnCaseSummarySubmit">
                <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>                                     
    In the above  code i am not added below code because in my master page i included that script manager
     <telerik:RadScriptManager ID="radAjaxScriptManager1" runat="server">
        </telerik:RadScriptManager>
    The following snippet used for the button click event to navigate the tab from one page to another

                       RadTabStrip tc = null;
                        System.Web.UI.WebControls.Literal ltMetaTags = null;
                        Control ctl = this.Parent.Parent;
                        tc = (RadTabStrip)ctl.FindControl("RadTabStrip1");
                        if (tc != null)
                        {
                            tc.TabIndex = 1;
                            tc.SelectedIndex = 1;
                            GoToNextTab();
                            GoToNextPageView();
                        }
            private void GoToNextTab()
            {
                RadTabStrip tabStrip = (RadTabStrip)this.NamingContainer.FindControl("RadTabStrip1");
                RadTab PartyDetailsTab = tabStrip.FindTabByValue("PartyDetails");
                PartyDetailsTab.Enabled = true;
                PartyDetailsTab.SelectedIndex = 1;
                PartyDetailsTab.Selected = true;
                
            }
            private void GoToNextPageView()
            {
                RadMultiPage multiPage = (RadMultiPage)this.NamingContainer.FindControl("RadMultiPage1");
                RadPageView PartyDetailsPageView = multiPage.FindPageViewByID("RadPageView2");
                PartyDetailsPageView.TabIndex = 1;
                PartyDetailsPageView.Selected = true;
              
            }
    what is the problem in my code i can't understand please help me from this problem i am struggling for this problem from 3 days. and also i need how to load only selected tab data only when i select tab no need to load all the data in remaining tabs.









  2. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 04 Mar 2014 Link to this post

    Hello Kaleswar,

    Since you had ajaxified the controls in the RadTabStrip and RadMultiPage, you should add an ajax setting, in order to specify that the button should update the RadTabStrip and the RadMuliPage. You could achieve this, following the approach demonstrated in this article or you could directly add the AjaxSettings in the UserControl in the following manner:
    protected void Page_Load(object sender, EventArgs e)
        {
            RadTabStrip tabStrip = (RadTabStrip)this.NamingContainer.FindControl("RadTabStrip1");
            RadMultiPage multiPage = (RadMultiPage)this.NamingContainer.FindControl("RadMultiPage1");
     
            RadAjaxManager AjaxManager = RadAjaxManager.GetCurrent(Page);
            AjaxManager.AjaxSettings.AddAjaxSetting(RadButton1, tabStrip);
            AjaxManager.AjaxSettings.AddAjaxSetting(RadButton1, multiPage);
        }

    In addition, I noticed that you are attempting to find the Tab by its value (using tabStrip.FindTabByValue("Party Details") ), but I noticed that you did not set any value for the RadTabs. I would suggest you either set the value of the Tabs (using Value property) or you could use the FindTabByText() method.

    Regards,
    Nencho
    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 UI for ASP.NET AJAX, subscribe to the blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top