Can I have 3 tabstrips refer to the same MultipageID?

2 posts, 0 answers
  1. Nate
    Nate avatar
    6 posts
    Member since:
    Apr 2013

    Posted 31 Jan 2014 Link to this post

    I have the below setup, where SideMultiPage is linked to a not mentioned tabstrip outside the Holder div and works fine:

    <div id="Holder">
            <script type="text/javascript">
                /* <![CDATA[ */
                function onTabSelecting(sender, args) {
     
                    if (args.get_tab().get_pageViewID()) {
                        args.get_tab().set_postBack(false);
                    }
                }
                /* ]]> */
            </script>
            <div id="SidemenuBar">
                <telerik:RadAjaxPanel ID="RadSidePanel" runat="server">
                    <telerik:RadMultiPage runat="server" ID="SideMultiPage" SelectedIndex="0">
                        <telerik:RadPageView runat="server" ID="PageviewPersoneelsleden">
                            <telerik:RadTabStrip ID="tabstripPersoneel" runat="server" MultiPageID="ContentMultiPage" Orientation="VerticalLeft" OnClientTabSelecting="onTabSelecting" OnTabClick="Sidebar_TabClick">
                                <Tabs>
                                    <telerik:RadTab Text="Personeelsfiche" PageViewID="Personeelsfiche" runat="server" Selected="True">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="Arbeidsovereenkomst" PageViewID="Arbeidsovereenkomst" runat="server">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="Asset" PageViewID="Asset" runat="server">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="Certificaat" PageViewID="Certificaat" runat="server">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="Ervaringen" PageViewID="Ervaring" runat="server">
                                    </telerik:RadTab>
                                </Tabs>
                            </telerik:RadTabStrip>
                        </telerik:RadPageView>
                        <telerik:RadPageView ID="PageviewAfwezigheden" runat="server">
                            <telerik:RadTabStrip ID="tabstripAfwezigheden" runat="server" MultiPageID="ContentMultiPage" Orientation="VerticalLeft" OnClientTabSelecting="onTabSelecting" OnTabClick="Sidebar_TabClick">
                                <Tabs>
                                    <telerik:RadTab Text="Afwezigheid inplannen" PageViewID="Afwezigheid" runat="server">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="Maandoverzicht afwezigheden" PageViewID="Maandoverzicht" runat="server">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="Jaaroverzicht afwezigheden" PageViewID="Jaaroverzicht" runat="server">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="Kalenderoverzicht" PageViewID="Kalender" runat="server">
                                    </telerik:RadTab>
                                </Tabs>
                            </telerik:RadTabStrip>
                        </telerik:RadPageView>
                        <telerik:RadPageView ID="PageviewWagens" runat="server">
                            <telerik:RadTabStrip ID="TabstripWagens" runat="server" MultiPageID="ContentMultiPage" Orientation="VerticalLeft" OnClientTabSelecting="onTabSelecting" OnTabClick="Sidebar_TabClick">
                                <Tabs>
                                    <telerik:RadTab Text="Wagens" PageViewID="Wagen" runat="server">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="Tankkaarten" PageViewID="Tankkaart" runat="server">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="Technische onderhouden" PageViewID="Onderhoud" runat="server">
                                    </telerik:RadTab>
                                    <telerik:RadTab Text="Expertiseverslagen" PageViewID="Expertiseverslag" runat="server">
                                    </telerik:RadTab>
                                </Tabs>
                            </telerik:RadTabStrip>
                        </telerik:RadPageView>
                    </telerik:RadMultiPage>
                </telerik:RadAjaxPanel>
            </div>
            <div id="Content">
                <telerik:RadAjaxPanel ID="RadMainPanel" runat="server">
                    <telerik:RadMultiPage ID="ContentMultiPage" SelectedIndex="0" OnPageViewCreated="ContentMultiPage_OnPageViewCreated" runat="server">
                    </telerik:RadMultiPage>
                </telerik:RadAjaxPanel>
            </div>
        </div>


    The codebehind is:
    protected void Page_Init(object sender, EventArgs e)
            {
                if (!Page.IsPostBack)
                {
                    AddPageView(tabstripPersoneel.FindTabByText("Personeelsfiche"));
                }
            }
     
            protected void Sidebar_TabClick(object sender, RadTabStripEventArgs e)
            {
                AddPageView(e.Tab);
                e.Tab.PageView.Selected = true;
            }
     
            private void AddPageView(RadTab tab)
            {
                RadPageView pageView = new RadPageView {ID = tab.PageViewID};
                ContentMultiPage.PageViews.Add(pageView);
            }
     
            protected void ContentMultiPage_OnPageViewCreated(object sender, RadMultiPageEventArgs e)
            {
                string userControlName ="/Controls/"+ e.PageView.ID + "Weergave.ascx";
     
                Control userControl = Page.LoadControl(userControlName);
                userControl.ID = e.PageView.ID + "_userControl";
     
                e.PageView.Controls.Add(userControl);
            }


    Everything on the first tabstrip opens fine. I haven't yet developed the second tabstrip. I have developed the "Wagen" page on the 3rd tabstrip. When I try to open this one, all events fire properly, the pageview gets added in the code-behind, but it doesn't appear on the page. When I then return to the first page and select one of those pages, that one loads fine, but even after returning to the Wagen tab, it still doesn't load it.

    i checked the generated HTML code. the Personeelsfiche control is loaded fine on page load. when I then go to TabstripWagens and select the one with text "Wagens", the generated code doesn't change. When I then go back to the first tabstrip and select Arbeidsovereenkomst, it loads the appropriate control, AND also adds the Wagenview as a hidden view. So it is not added immediately. so it appears like you CAN have 2 tabstrips with the same multipageID. In fact, when I change .rmpHiddenView to not have "display: none", it can show the control, and the control's code-behind works, so I know that it's accessible. The control just isn't shown properly when there are 2 or more tabstrips linked.

    Is this a bug or intended behaviour?
  2. Nate
    Nate avatar
    6 posts
    Member since:
    Apr 2013

    Posted 31 Jan 2014 in reply to Nate Link to this post

    I figured this out on my own. I forgot to add the relevant controls to my AjaxSettings, which meant they didn't trigger Ajax.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top