Popup on Tab Change

3 posts, 0 answers
  1. Rahul Khinvasara
    Rahul Khinvasara avatar
    303 posts
    Member since:
    Aug 2007

    Posted 11 Jun 2008 Link to this post

     
    I am binding telerik:RadTabStrip in code behind through database.

    <telerik:RadDockLayout id="RadDockingManager1" runat="server"></telerik:RadDockLayout>     
                             <telerik:RadTabStrip ID="RadTabStrip1"  runat="server" AutoPostBack="true" ontabclick="RadTabStrip1_TabClick"
                                      MultiPageID="RadMultiPage1" OnClientTabSelecting="OnClientTabSelecting" CausesValidation="false">
                              </telerik:RadTabStrip>

     

     

      function OnClientTabSelecting(sender, args)
                {
                    var tabtext = args.get_tab().get_text();
                  
                    if(tabtext == "Home")
                    {
                       /**some code here**/     
               _btn.click();
                        return false;
                    }
                   
                    else if(tabtext == "Contact")
                    {
                        var ch = ShowContactDialog();
                        return ch;
                    }
                    else if(tabtext == "Career")
                    {
                        var ch = ShowCareerDialog();
                        return ch;
                    }
                }           
           
                function ShowContactDialog()
                {
                   var discountW = window.radopen("Tab_Pop_Ups/Contact_Dialog.aspx","ModalityDialog");
                   
                    discountW.SetSize (220,290);
                     return false;
                }
               
                function ShowCareerDialog()
                {
                   var discountW = window.radopen("Tab_Pop_Ups/Career_Dialog.aspx","LocationDialog");
                   
                    discountW.SetSize (220,290);
                     return false;
                }

     

     public void BindTabStrip(int TabCount, DataSet ds)
        {
            try
            {
                 for (int i = 0; i < TabCount; i++)
                {
                    RadTab NewTab = new RadTab();

                    NewTab.Text = ds.Tables[0].Rows[i]["TabName"].ToString();

                    RadTabStrip1.Tabs.Add(NewTab);
                    RadPageView pv = new RadPageView();
                    pv.ID = i.ToString() + "_PageView";
                    RadMultiPage1.PageViews.Add(pv);
                }
            }
            catch (Exception ex)
            {
                Response.Write("Account_Dashboard.aspx_:BindTabStrip" + ex.Message.ToString());
            }
        }

     

     

    and on tab change i want to open a popup window, in which i have ok and cancel button .
    If i will click on ok it will change to clicked tab otherwise it will remain in the same tab.For this i am calling the javascript function

    OnClientTabSelecting.

    As soon i click on another tab it will open the popup window and also changed the tab.
    I want that it should not change the tab untill i click on OK of popup window and if i click on cancel it should remain in the same tab.

    EX if i have three tab Home, Contact and Career and current activated tab is say Home.If i click on Contact it should open the popup window

    with list of contacts and OK & cancel button and the activated tab is Home until i click on Ok.

    But in my case it change the tab as popup opened.

    Please help.

  2. Rahul Khinvasara
    Rahul Khinvasara avatar
    303 posts
    Member since:
    Aug 2007

    Posted 11 Jun 2008 Link to this post

    Also i am using telerik:RadWindowManager for popup to open 

     <telerik:RadWindowManager ID="rwm1" Skin="WebBlue" runat="server" >
                                       <Windows>
                                            <telerik:RadWindow
                                                        Behavior="Move,Reload,Close"
                                                        NavigateUrl="~/Contact_Dialog.aspx"
                                                        Runat="server"
                                                        Id="ContactDialog"
                                                        VisibleStatusbar="false"
                                                        OnClientClose="OnClientClose"
                                                        Skin="WebBlue"
                                                        Modal="true"
                                                        ClientCallBackFunction="ClientCallBackFunction">
                                            </telerik:RadWindow>
                                            <telerik:RadWindow
                                                        Behavior="Move,Reload,Close"
                                                        NavigateUrl="~/Career_Dialog.aspx"
                                                        Runat="server"
                                                        Id="CareerDialog"
                                                        VisibleStatusbar="false"
                                                        OnClientClose="OnClientClose"
                                                        Skin="WebBlue"
                                                        Modal="true"
                                                        ClientCallBackFunction="ClientCallBackFunction">
                                            </telerik:RadWindow>
                                          
                                       </Windows> 
                            </telerik:RadWindowManager>
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 11 Jun 2008 Link to this post

    Hi Rahul,

    I attached to this thread a small sample that shows how to achieve the desired behavior with radconfirm. Please use this code as a base and extend it further to fit your scenario.


    Greetings,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top