title: JavaScript not working for second Tab/RadTab
body: <p>I have two nested gridviews inside two radtabs, for this two nested views, I have a simple JavaScript for Expand and Collapse.  </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function collapseExpand(obj) {
          var gvObject = document.getElementById(obj);
          var imageID = document.getElementById('image' + obj);
  
          if (gvObject.style.display == "none") {
              gvObject.style.display = "inline";
              imageID.src = "~/ims/Images/bullet_toggle_minus.jpg";
          }
          else {
              gvObject.style.display = "none";
              imageID.src = "~/ims/Images/bullet_toggle_plus.jpg";
          }
      }
  </code></pre>
  
  <p></p>
  
  <p>The Java Script is working fine for the first RadGrid of the first tab. However, its not working with the second tab. I think the control is not able to transfer to the second grid. I think my problem is similar to </p>
  
  <p><a href="http://weblogs.asp.net/hajan/archive/2010/10/07/make-them-to-love-each-other-asp-net-ajax-updatepanels-amp-javascript-jquery-functions.aspx" rel="nofollow">http://weblogs.asp.net/hajan/archive/2010/10/07/make-them-to-love-each-other-asp-net-ajax-updatepanels-amp-javascript-jquery-functions.aspx</a></p>
  
  <p>I applied all the methods listed there but still its not working. </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function load() {
          Sys.WebForms.PageRequestManager.getInstance().add_endRequest(collapseExpand);
      } 
      function collapseExpand(obj) {
          var gvObject = document.getElementById(obj);
          var imageID = document.getElementById('image' + obj);
  
          if (gvObject.style.display == "none") {
              gvObject.style.display = "inline";
              imageID.src = "~/ims/Images/bullet_toggle_minus.jpg";
          }
          else {
              gvObject.style.display = "none";
              imageID.src = "~/ims/Images/bullet_toggle_plus.jpg";
          }
      }
  </code></pre>
  
  <p></p>
  
  <p>Can somebody tell me what code to write to transfer or pass the control of javascript to the second tab? </p>
  
  <p>Also, I am using Radtabs and RadPageView to display two grids in two tabs. </p>
  
  <p>I am calling the Collapse Expand inside radtab</p>
  
  <pre><code>&lt;telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0" MultiPageID="RadMultipage1"&gt;
  &lt;Tabs&gt;
  &lt;telerik:RadTab Text="Tab1" PageViewID="RadPageView1" OnLoad="Load1"&gt;
    &lt;/telerik:RadTab&gt;
    &lt;telerik:RadTab Text="Tab2" PageViewID="RadPageView2" &gt;
   &lt;/telerik:RadTab&gt;
   &lt;/Tabs&gt;
   &lt;/telerik:RadTabStrip&gt;
   &lt;telerik:RadMultiPage ID="RadMultipage1" runat="server"&gt;
  &lt;telerik:RadPageView ID="RadPageView1" runat="server" Width="100%" TabIndex="0"&gt;
  &lt;telerik:RadGrid ID="View1" runat="server" AutoGenerateColumns="False" Width="100"
      BackColor="White" BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" 
        OnItemDataBound="RadGrid2_ItemDataBound" &gt;
     &lt;MasterTableView DataKeyNames="id"&gt;
     &lt;Columns&gt;
     &lt;telerik:GridTemplateColumn&gt;
     &lt;ItemTemplate&gt;
     &lt;a href="javascript:collapseExpand('id_&lt;%# Eval("id") %&gt;');"&gt;
     &lt;img id="imageSubId_&lt;%# Eval("id") %&gt;" alt="Click to show/hide orders" border="0" src="Images/bullet_toggle_plus.jpg" /&gt;
     &lt;/a&gt;
     &lt;/ItemTemplate&gt;
     &lt;/telerik:GridTemplateColumn&gt;
     &lt;telerik:GridBoundColumn DataField="id" HeaderText="ID"/&gt;
     &lt;telerik:GridBoundColumn DataField="fname" HeaderText="First Name"/&gt;
     &lt;telerik:GridBoundColumn DataField="lname" HeaderText="Last Name"/&gt;
     &lt;telerik:GridBoundColumn DataField="DOB" HeaderText="Date of Birth"/&gt;
     &lt;telerik:GridTemplateColumn&gt;
     &lt;ItemTemplate&gt;
              &lt;tr&gt;
              &lt;td colspan="100%"&gt;
              &lt;div id="id_&lt;%# Eval("id") %&gt;" style="display: none; position: relative; left: 10px;"&gt;
              &lt;telerik:RadGrid ID="View2" runat="server" AutoGenerateColumns="false" Width="400"
                      GridLines="None" &gt;
              &lt;MasterTableView &gt;
                      &lt;Columns&gt;
                      &lt;telerik:GridBoundColumn DataField="fname" HeaderText="First Name" /&gt;
                      &lt;telerik:GridBoundColumn DataField="mname" HeaderText="Middle Name" /&gt;
                      &lt;telerik:GridBoundColumn DataField="lname" HeaderText="Last Name" /&gt;
                      &lt;telerik:GridTemplateColumn&gt;
                      &lt;ItemTemplate&gt;
                      &lt;asp:CheckBox ID="checkselect" runat="server" /&gt;
                      &lt;/ItemTemplate&gt;
                      &lt;HeaderTemplate&gt;
                      &lt;asp:Button ID="Button4" runat="server" Text="Remove"  CommandName="Split" OnClick="Button4_Click" /&gt;
                      &lt;/HeaderTemplate&gt;
                      &lt;/telerik:GridTemplateColumn&gt;
                      &lt;/Columns&gt;
                      &lt;/MasterTableView &gt;
               &lt;/telerik:RadGrid&gt;
               &lt;/div&gt;
               &lt;/td&gt;
               &lt;/tr&gt;
   &lt;/ItemTemplate&gt;
   &lt;/telerik:GridTemplateColumn&gt;
   &lt;/Columns&gt;
   &lt;/MasterTableView&gt;
   &lt;/telerik:RadGrid&gt;
     &lt;/telerik:RadPageView&gt;
  &lt;telerik:RadPageView ID="RadPageView2" runat="server" Width="100%"&gt;
   Same Code
   &lt;/telerik:RadPageView&gt;
     &lt;/telerik:RadMultiPage&gt;
  </code></pre>