c1Flexgrid with button to Expand or Collapse Nodes

Posted by: levanduyet on 21 June 2024, 7:41 am EST

  • Posted 21 June 2024, 7:41 am EST - Updated 21 June 2024, 7:46 am EST

    Hi,

    I have group data in c1flexgrid. Then I export to Excel.

    I can just click 1 button in Excel then all the node of group level will be expanded or collapsed.

    Could I do that with c1flexgrid.

    Thanks,

    Duyet Le

  • Posted 24 June 2024, 3:18 am EST

    Hello Duyet,

    We are sorry, but there is no direct way to implement this in FlexGrid. You can create buttons dynamically, as per FlexGrid.Tree.MaximumLevel and use FlexGrid.Tree.Show() method to expand all nodes up to the specified level and collapse others.

    Please refer to the attached sample for implementation. (see TreeNode.zip)

    Regards,

    Uttkarsh.

  • Posted 24 June 2024, 8:31 am EST

    Hello Duyet,

    We apologize for the oversight, but there is also a direct method that works similarly to Excel’s button bar. You can set Tree.Style to TreeStyleFlags.ButtonBar | TreeStyleFlags.CompleteLeaf as follows:

    flex.Tree.Style = TreeStyleFlags.ButtonBar | TreeStyleFlags.CompleteLeaf;

    Please refer to the attached modified sample for implementation. (see TreeNode_Mod.zip)

    The custom implementation we provided in the previous response includes an extra feature: you can collapse and expand the nodes with consecutive button clicks. You can choose whichever solution best meets your requirements.

    Regards,

    Uttkarsh.

  • Posted 26 June 2024, 1:44 am EST

    Hi Ullkarsh,

    Thanks,

    Duyet Le

Need extra support?

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

Learn More

Forum Channels