collapseAll

2 posts, 1 answers
  1. Andre
    Andre avatar
    41 posts
    Member since:
    Feb 2018

    Posted 18 Oct 2018 Link to this post

    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é

  2. Answer
    Dimitar
    Admin
    Dimitar avatar
    2842 posts

    Posted 19 Oct 2018 Link to this post

    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.
Back to Top