I would like to find the nested GridView `gvR` on a button click, so that I can add a row to it. I will post the GridView markup and then the code for adding the row to the selected nested grid.

```
<asp:LinkButton ID="btnAdd" runat="server" Text="Add Room" 
            onclick="btnAdd_Click"></asp:LinkButton>
        <asp:GridView ID="gvRP" runat="server" AutoGenerateColumns="false" 
            onrowdatabound="gvRP_RowDataBound" 
            onrowediting="gvRP_RowEditing">
        <Columns>
        <asp:TemplateField HeaderText="Room" ItemStyle-Width="100%">
        <ItemTemplate>
        <asp:Label runat="server" Text="Room"></asp:Label>
        <asp:DropDownList ID="ddlRoom" runat="server" AutoPostBack="True" DataTextField="Name"
            DataValueField="Id" AppendDataBoundItems="true" OnSelectedIndexChanged="ddlRoom_SelectedIndexChanged">
            <asp:ListItem Value="-1">Select...</asp:ListItem>
        </asp:DropDownList>
        <asp:Label runat="server" AssociatedControlID="ddlRate" Text="Rate" ID="lblRate"></asp:Label><asp:DropDownList
            ID="ddlRate" runat="server" AppendDataBoundItems="true" DataTextField="Name"
            DataValueField="Id">
            <asp:ListItem Value="-1">Select...</asp:ListItem>
        </asp:DropDownList>

        <asp:Label  runat="server" Text="Adults"></asp:Label>
        <asp:TextBox ID="txtAdults" Text='<%#Bind("Adults") %>' runat="server" Width="25px"></asp:TextBox>
        <asp:Label  runat="server" Text="Children"></asp:Label>
        <asp:TextBox ID="txtChildren" Text='<%#Bind("Children") %>' runat="server"  Width="25px"></asp:TextBox>
        <asp:Label runat="server" Text="Check In"></asp:Label>
        <asp:TextBox ID="txtCheckIn" Text='<%#Bind("CheckIn") %>' runat="server" Width="75px"></asp:TextBox>
        <asp:Label  runat="server" Text="Check Out"></asp:Label>
        <asp:TextBox ID="txtCheckOut" Text='<%#Bind("CheckOut") %>' runat="server"  Width="75px"></asp:TextBox>

        <h3>Rates</h3>
        <asp:GridView ID="gvR" runat="server" AutoGenerateColumns="false">
        <Columns>
        <asp:BoundField DataField="Name" HeaderText="Rate" />
        <asp:BoundField DataField="Effective" HeaderText="Effective" />
        <asp:BoundField DataField="Expire" HeaderText="Expire" />
        <asp:BoundField DataField="Amount" HeaderText="Amount" />
        <asp:BoundField DataField="Code" HeaderText="Currency" />
        </Columns>
        </asp:GridView>
        </ItemTemplate>
        </asp:TemplateField>
        </Columns>
        </asp:GridView>

```

Code for adding Rate:

```
protected void AddRate(object sender, EventArgs e)
{
    lstRateDetails = (List<RateDetail>)ViewState["Rates"];

    lstRateDetails.Insert(0, new RateDetail());
    //Have no idea what to do here? I have also tried gvRatePlans.TemplateControl...
    GridView gvR = (GridView)gvRP.FindControl("gvR");
    gvR.DataSource = lstRateDetails;
    gvR.DataBind();

    ViewState["Rates"] = lstRateDetails;
}

```