I have a need to close all the nestedviewtemplates in my grid before leaving the page. I've tried the below code and it does not close all the rows. Any suggestions.
}
}
foreach
(GridItem item in rdInsLines.MasterTableView.Controls[0].Controls)
{
if (item is GridDataItem)
{
if (item.Expanded)
{
item.FireCommandEvent(
"ExpandCollapse", String.Empty);
}
}
}