which may be why collapseAll doesn't work.
i give the command collapseAll after filling the grid but all subgrids are still visible.
this.dgvOrder.Templates.Add(dgvOperationTemplate);
dgvOperationTemplate.DataSource = Sql.Dashboard_listOperationHierarchy();
// layout
dgvOperationTemplate.ReadOnly = true;
dgvOperationTemplate.ShowRowHeaderColumn = false;
//templateOperation.AutoScroll = true;
dgvOperationTemplate.MasterTemplate.AutoGenerateColumns = true;
dgvOperationTemplate.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.None;
dgvOperationTemplate.BestFitColumns(BestFitColumnMode.AllCells);
GridViewRelation reletionOrderOperation = new GridViewRelation(dgvOrder.MasterTemplate, dgvOperationTemplate) { RelationName = "OrderOperation" };
reletionOrderOperation.ParentColumnNames.Add(ColumnTitle.GridOrder.WNNr);
reletionOrderOperation.ChildColumnNames.Add(ColumnTitle.GridOperation.WNNr);
this.dgvOrder.Relations.Add(reletionOrderOperation);
dgvOperationTemplate.CollapseAll();
dgvOperationTemplate.CollapseAllGroups();
andré