This is a migrated thread and some comments may be shown as answers.

Popup on Tab Change

2 Answers 23 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rahul Khinvasara
Top achievements
Rank 1
Rahul Khinvasara asked on 11 Jun 2008, 09:47 AM

 
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 Answers, 1 is accepted

Sort by
0
Rahul Khinvasara
Top achievements
Rank 1
answered on 11 Jun 2008, 09:53 AM
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>
0
Georgi Tunev
Telerik team
answered on 11 Jun 2008, 03:04 PM
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
Tags
General Discussions
Asked by
Rahul Khinvasara
Top achievements
Rank 1
Answers by
Rahul Khinvasara
Top achievements
Rank 1
Georgi Tunev
Telerik team
Share this question
or