protected void ParentGrid_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Update")
{
ImageButton img = (ImageButton)e.CommandSource as ImageButton;
GridViewRow row = img.NamingContainer as GridViewRow;
GridView chil= (GridView )row.FindControl("ChildgridId");
SqlCommand cmd=new SqlCommand("select * from table",connectionstring);
Dataset ds;
SqlDataAdapter ad=new SqlDataAdapter(cmd);
ad.Fill(ds);
Bind the values from the query to Chil datasource
chil.DataSource=ds;
chil.DataBind();
}
}