This is a migrated thread and some comments may be shown as answers.

collapseAll

1 Answer 7 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Andre
Top achievements
Rank 1
Andre asked on 18 Oct 2018, 04:47 PM

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é

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 19 Oct 2018, 10:40 AM
Hello Andre,

The CollapseAll methods should be called after the grid layout is loaded. For example, you can use the Load event of the form, or you can force the layout with the following method:
radGridView1.LoadElementTree();

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Andre
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or