Hi,
Set the command name to the buttion at parent gridview header as "CollapsAll". Handle "CollapsAll" command as follows:
protected void gvEmpDetails_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "CollapsAll")
{
fnCollapsAll();
}
}
Now in fnCollapsAll set the all child grid-view data source to null as follows:
private void fnCollapsAll(){
foreach(DataRow row in grvRecords.Rows){
GridView gv=(GridView)row.FindControl("gvChild");
gv.DataSource=null;
gv.DataBind();
}
}
All the best.
--Amit