C1DataGrid Collapse / Expand Groups in Code/Xaml

Posted by: m.bleimuth on 19 January 2018, 1:23 am EST

    • Post Options:
    • Link

    Posted 19 January 2018, 1:23 am EST

    Hi,

    i would like to collapse/expand the groups in a c1datagrid. Right now the groups

    are automatically expaned when a user drops a column in the droparea.

    Is it possible to not automatically expand the groups?

    I would also like to be able to expand/collapse all groups within my code. I could not find any function so far which would give me that possibility.

    KR Manuel

  • Posted 21 January 2018, 3:54 pm EST

    Hi,

    You can use CollapseAll/Collapse and ExpandAll/Expand methods for achieving your requirements in GroupChanged event of C1DataGrid.

            private void Datagrid_GroupChanged(object sender, C1.WPF.DataGrid.DataGridGroupChangedEventArgs e)
            {
                //Use Collapse for Collapse specific row
                // CollapseAll for all rows
                datagrid.Rows.CollapseAll();            
    
                //Use ExpandAll for expending all
                //Use below code for expanding specific row only
                datagrid.Rows.Expand(r => r.Index == 0);
            }
    

    Hope, this will help you.

    Thanks,

    Singh

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels