ondemad loading on TabClick

3 posts, 0 answers
  1. Srinivasa Gokidi
    Srinivasa Gokidi avatar
    15 posts
    Member since:
    Jun 2010

    Posted 07 Apr 2011 Link to this post

    HI,

    I am working on Radtab ondemand loading. When i click on the tab i just want to load that tab. I see your example but you are loading .ascx page on demand. Can i use aspx pages.  I have 10 tabs with 10 pageviews. first 2 pageviews have grids within the pageview itself  and other 8 tabs when i clcik on the tab i want to show different aspx pages in that associated pageview. NavigateURL is not wotking for my scenario. How to achive this scenario. ANy example would be best for me to understand. I tried the way in your example but its throwing some error for aspx pages. Here is my sample code Please look into it. Thanks.

    <telerik:RadTabStrip ID="RadTabSieHistory" runat="server" Skin="Vista" MultiPageID="RadMultiPageSieHistory"
        OnTabClick="RadTabSieHistory_TabClick">
        <Tabs>
            <telerik:RadTab Text="Search Results" PageViewID="RPVSearchResults">
            </telerik:RadTab>
            <telerik:RadTab Text="Process Flow" PageViewID="RPVProcessFlow">
            </telerik:RadTab>
            <telerik:RadTab Text="Task History" PageViewID="EditWinTaskHistory">
            </telerik:RadTab>
            <telerik:RadTab Text="Order Details" PageViewID="RPVOrdDetails">
            </telerik:RadTab>
            <telerik:RadTab Text="Fiber Details" PageViewID="RPVFiberDet">
            </telerik:RadTab>
            <telerik:RadTab Text="Dependencies" PageViewID="RPVDependncy">
            </telerik:RadTab>
            <telerik:RadTab Text="Jeopardy" PageViewID="RPVJeop">
            </telerik:RadTab>
            <telerik:RadTab Text="Attachments" PageViewID="RPVAttachments">
            </telerik:RadTab>
            <telerik:RadTab Text="Notes" PageViewID="RPVNotes">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPageSieHistory" runat="server" BorderStyle="Solid"
        BorderWidth="1px" BackColor="White" BorderColor="Black" OnPageViewCreated="RadMultiPageSieHistory_PageViewCreated">
        <telerik:RadPageView ID="RPVSearchResults" runat="server">
            <asp:label id="lblMsg" runat="server" font-bold="True" font-size="10pt" backcolor="Yellow"
                forecolor="Black"></asp:label>
            <div style="text-align: right; font-size: 8pt" id="div1" runat="server">
                <asp:linkbutton id="lnkbtnViewAll" onclick="lnkbtnViewAll_Click" runat="server" text="View All"></asp:linkbutton>
                  Total Records found: <asp:label id="lblTotRecCount" font-bold="True"
                    runat="server" forecolor="Black" font-size="10pt" text="0"></asp:label>
            </div>
            <div style="overflow: auto; height: 460px">
                <asp:gridview id="gvSites" borderwidth="0px" borderstyle="None" runat="server" backcolor="White"
                    bordercolor="White" cellspacing="1" allowpaging="True" width="98.6%" onrowdatabound="gvSites_RowDataBound"
                    onselectedindexchanged="gvSites_SelectedIndexChanged" onpageindexchanging="gvSites_PageIndexChanging"
                    pagesize="15" allowsorting="True" onsorting="gvSites_Sorting" autogeneratecolumns="False"
                    onrowcommand="gvSites_RowCommand">
                    <AlternatingRowStyle Font-Size="8pt" BackColor="#F5F5E9" BorderWidth="0px" BorderColor="White" />
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:Image ID="imgOrdStat" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="OrderType" />
                        <asp:BoundField DataField="LineOfBusiness" SortExpression="LineOfBusiness" HeaderText="LOB" />
                        <asp:BoundField DataField="DivisionName" SortExpression="DivisionName" HeaderText="Division Name" />
                        <asp:BoundField DataField="MarketName" SortExpression="MarketName" HeaderText="Region/ Market Name" />
                        <asp:BoundField DataField="CarrierName" SortExpression="CarrierName" HeaderText="Customer Name" />
                        <asp:BoundField DataField="HeadendName" SortExpression="HeadendName" HeaderText="Headend Name" />
                        <asp:BoundField DataField="ProjectName" SortExpression="ProjectName" HeaderText="Project Name" />
                        <asp:BoundField DataField="siteId" SortExpression="siteId" HeaderText="site Id" />
                        <asp:BoundField DataField="SiteName" SortExpression="SiteName" HeaderText="Site Name" />
                        <asp:BoundField DataField="Address" SortExpression="Address" HeaderText="Site Address" />
                        <asp:BoundField DataField="quoteId" SortExpression="quoteId" HeaderText="Quote ID" />
                        <asp:BoundField DataField="PTD" SortExpression="PTD" HeaderText="PTD" />
                        <asp:BoundField DataField="orderStatus" SortExpression="orderStatus" HeaderText="Order Status" />
                        <asp:BoundField DataField="orderId" />
                        <asp:BoundField DataField="MixedOrder" HeaderText="MixOrd" />
                        <asp:BoundField DataField="ServiceOrderNumber" HeaderText="Service Order Number"
                            SortExpression="Service Order Number" />
                        <asp:TemplateField Visible="False">
                            <ItemTemplate>
                                <asp:Label ID="lblOrdType" runat="server" Text='<%# Bind("orderTypeDesc") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="imgDet" ToolTip="View network diagram" CommandName="Details"
                                    ImageUrl="Images/Details.gif" runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="imgMixDet" ToolTip="View Mixed Order Details" CommandName="Mixed"
                                    ImageUrl="Images/MIXED.png" runat="server" Visible="false" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="White" ForeColor="#000066" BorderWidth="0px" />
                    <HeaderStyle Height="20px" BackColor="#004000" Font-Size="8pt" Font-Bold="True" ForeColor="White"
                        HorizontalAlign="Center" BorderWidth="0px" />
                    <PagerSettings Mode="NumericFirstLast" />
                    <PagerStyle HorizontalAlign="Right" Font-Bold="True" Font-Size="8pt" />
                    <RowStyle ForeColor="#3C5F22" Font-Size="8pt" BackColor="White" BorderWidth="0px"
                        BorderColor="White" />
                </asp:gridview>
            </div>
        </telerik:RadPageView>
        <telerik:RadPageView ID="RPVProcessFlow" runat="server">
            <div style="overflow: auto; width: 100%; overflow-y: hidden" align="center">
                <syncfusion:diagramwebcontrol cssclass="diadisplay" bordercolor="White" borderstyle="NotSet"
                    borderwidth="0" id="DiagramWebControl1" runat="server" width="100%" waitingpopuptext="Processing"
                    dbclicktimeoutdelay="1" disabledbackgroundcolor="LightBlue" waitingpopupautoformat="Indicator"
                    boundaryconstraintsenabled="True" documentid="f69befd0-b591-42af-a1c6-377dd730c290"
                    enablexhtml="true" height="485px" onnodeclick="DiagramWebControl1_NodeClick" />
            </div>
        </telerik:RadPageView>
        <telerik:RadPageView ID="RPVTskHis" runat="server">
        </telerik:RadPageView>
        <telerik:RadPageView ID="RPVOrdDetails" runat="server">
        </telerik:RadPageView>
        <telerik:RadPageView ID="RPVFiberDet" runat="server">
        </telerik:RadPageView>
        <telerik:RadPageView ID="RPVDependncy" runat="server">
        </telerik:RadPageView>
        <telerik:RadPageView ID="RPVJeop" runat="server">
        </telerik:RadPageView>
        <telerik:RadPageView ID="RPVAttachments" runat="server">
        </telerik:RadPageView>
        <telerik:RadPageView ID="RPVNotes" runat="server">
        </telerik:RadPageView>
    </telerik:RadMultiPage>
    protected void RadMultiPageSieHistory_PageViewCreated(object sender, RadMultiPageEventArgs e)
        {
            //if (e.PageView.ID.ToLower() == "rpvtskhis")
            //{
            //    Page.LoadControl("EditWinTaskHistory.aspx");
            //}
            //else if (e.PageView.ID.ToLower() == "rpvorddetails")
            //{
            //    Page.LoadControl("EditWinOrderData.aspx");
            //}
            //else if (e.PageView.ID.ToLower() == "rpvfiberdet")
            //{
            //    Page.LoadControl("EditWinFiberConstructionCost.aspx");
            //}
     
            if(e.PageView.ID == "EditWinTaskHistory")
                Page.LoadControl("EditWinTaskHistory.aspx");
     
            //string userControlName = e.PageView.ID + ".aspx";
     
            //Control userControl = Page.LoadControl(userControlName);
            //userControl.ID = e.PageView.ID + "_userControl";
     
            //e.PageView.Controls.Add(userControl);
        }
     
        protected void RadTabSieHistory_TabClick(object sender, RadTabStripEventArgs e)
        {
            if (e.Tab.Index != 0 && e.Tab.Index != 1)
            {
                AddPageView(e.Tab);
                e.Tab.PageView.Selected = true;
            }
        }
     
        private void AddPageView(RadTab tab)
        {
            RadPageView pageView = new RadPageView();
            pageView.ID = tab.PageViewID;
            RadMultiPageSieHistory.PageViews.Add(pageView);
            tab.PageViewID = pageView.ID;
        }
  2. Prava kafle
    Prava kafle avatar
    212 posts
    Member since:
    Apr 2010

    Posted 08 Apr 2011 Link to this post

    Hi Srinivasa,

    On Tab Click event, you can set the content url for selected pageview as shown below. Here I am loading pages on demand.

    protected void RadTabSieHistory_TabClick(object sender, RadTabStripEventArgs e)
        {
            if (e.Tab.Index != 0 && e.Tab.Index != 1)
            {
                AddPageView(e.Tab);
                e.Tab.PageView.Selected = true;
            }
        
              string  currentTabText = RadTabStrip1.SelectedTab.Text;
               switch (currentTabText)
                {
                  case"Search "Results":
                        RadMultiPage1.PageViews[0].ContentUrl = "RPVSearchResults.aspx";
                        RadMultiPage1.PageViews[0].Selected = true;
                        break;
                    case "Process Flow":
                        RadMultiPage1.PageViews[1].ContentUrl = "RPVProcessFlow.aspx";
                        RadMultiPage1.PageViews[1].Selected = true;
                        break;
                    case "Task History":
                        RadMultiPage1.PageViews[2].ContentUrl = "EditWinTaskHistory.aspx";
                        RadMultiPage1.PageViews[2].Selected = true;
                        break;
                   ......
                   .....
                   .......
                   ......
                   .......
                    default:
                        RadMultiPage1.PageViews[5].ContentUrl = "EditWinTaskHistory.aspx";
                        RadMultiPage1.PageViews[5].Selected = true;
                        break;     
                }
        }
    Regards,
    Prava
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Gia
    Gia avatar
    5 posts
    Member since:
    Jun 2012

    Posted 08 Nov 2012 Link to this post

     If you just need to reload the content on each click, this works.  The issue I had was on one tab  the user could update data that needed to be refreshed on another tab.  With this, the content of the tab always reloads on click and refresh the updated data.

     

    protected void RadTab_TabClick(object sender, RadTabStripEventArgs e)

    {

     

        int tabIndexSelected = RadTab1.SelectedIndex;

         RadMultiPage1.PageViews[tabIndexSelected].Selected = true;
    }

     

     

     

     

Back to Top