///展开所有明细
private List<int> expandedRows = new List<int>();
void ExpandAllDetails(GridView gridview)
{
if (gridview.RowCount>0)
{
expandedRows.Clear();
gridview.BeginUpdate();
try
{
int dataRowCount = gridview.DataRowCount;
int rHandle = 0;
for (rHandle = 0; rHandle < dataRowCount; rHandle++)
{
expandedRows.Add(rHandle);
}
}
finally
{
gridview.EndUpdate();
}
ExpandDetails(gridview);
}
}
private void ExpandDetails(GridView view)
{
GridViewInfo info = (GridViewInfo)view.GetViewInfo();
foreach (GridDataRowInfo rInfo in info.RowsInfo)
{
if (expandedRows.Contains(rInfo.RowHandle))
{
view.ExpandMasterRow(rInfo.RowHandle);
expandedRows.Remove(rInfo.RowHandle);
}
}
}