Collapse All and Expand All functionality on Single click on GridView

Posted by: Swapnil.Walwadkar on 27 November 2017, 7:19 pm EST

    • Post Options:
    • Link

    Posted 27 November 2017, 7:19 pm EST

    Hello,

    I am using C1 DataGrid in my MVVM project.

    I am grouping the rows according to its’category. I would like to know how we can achieve ‘Collapse All’ and ‘Expand All’ functionality on single click on GridView.

  • Posted 28 November 2017, 8:50 pm EST

    Hi,

    For expanding/collapsing all the groups in C1DataGrid, you need to use its Rows.ExpandAll() / Rows.CollapseAll() method respectively. Also, in order to be able to access grid in code behind, I have created a custom VisualTreeHelper class to find the C1DataGrid element in GridView.

    Please refer to the uploaded sample application for complete implementation.

    URL for downloading applicaiton: https://www.dropbox.com/s/3fmz4zeszvn1kv4/DataGridSample_MVVM.zip?dl=0

    Do let me know, if you need any further help.

    Regards,

    Ruchir Agarwal

Need extra support?

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

Learn More

Forum Channels