title: How to access nested grid view rows from parent RowUpdating method
body: <p>I have a child grid view which add to parent grid view in parent RowDataBound. On parent editing, all the child gridview rows are ready to edit. It means that child doesn't have edit itself. How can I get child gridview rows in parent RowUpdating to save edited data?</p>
  
  <pre><code> protected void gvEquipment_RowDataBound(object sender, GridViewRowEventArgs e)
    {  
      if (e.Row.RowType == DataControlRowType.DataRow)
      {
          GridView gvChild = new GridView();
          gvChild.DataSource = dt;
          gvChild.CssClass = "NestedGrid";
          gvChild.RowDataBound += new GridViewRowEventHandler(gvChild_RowDataBound);
  
          //Create the show/hide button which will be displayed on each row of the main GridView
          Image imgCollapse = new Image();
          imgCollapse.ID = "btnCollapse";
          imgCollapse.ImageUrl = "~/images/Collapse.gif";
          //Add the javascript function to the show/hide button, passing the row to be toggled as a parameter");
          imgCollapse.Attributes.Add("onclick", "javascript: gvrowtoggle(" + (e.Row.RowIndex + e.Row.RowIndex + 2) + ")");
  
          //Add the expanded details row after each record in the main GridView
          Table tb1 = e.Row.Parent as Table;
          GridViewRow tr = new GridViewRow(e.Row.RowIndex + 1, -1, DataControlRowType.EmptyDataRow, DataControlRowState.Normal);
          tr.CssClass = "hidden";
          string sr = (e.Row.RowIndex + e.Row.RowIndex + 2).ToString();
          tr.ID = e.Row.RowIndex.ToString();
          TableCell tc = new TableCell();
          tc.ColumnSpan = gvEquipment.Columns.Count + 3;//e.Row.Cells.Count;
          tc.BorderStyle = BorderStyle.None;
          //tc.BackColor = System.Drawing.Color.WhiteSmoke;
          tc.Controls.Add(gvChild);
          tr.Cells.Add(tc);
          tb1.Rows.Add(tr);
          e.Row.Cells[0].Controls.Add(imgCollapse);
          e.Row.CssClass = "GridAltItem";
          gvChild.DataBind();
  
  
       if (IsEditMode &amp;&amp; e.Row.RowIndex == EditIndex)
       {
           // edit mode for childGrid
           for (int i = 0; i &lt; dt.Rows.Count; i++)
               for (int j = 0; j &lt; dt.Columns.Count; j++)
               {
                   TextBox txt = new TextBox();
                   txt.Text = dt.Rows[i][j].ToString();
                   gvChild.Rows[i].Cells[j].Controls.Add(txt);
               }
       }
      }
  }
  
   protected void gvEquipment_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        GridView gv = (GridView)sender;
        //how to get child gridview controls?
    }
  </code></pre>