FlexGrid for WinForms | ComponentOne
In This Topic
    Tree Grid
    In This Topic

    One of the unique and popular features of the C1FlexGrid control is the ability to add hierarchical grouping to regular data grid and display it in a Tree like structure. You can display hierarchical views of the data in a Tree Grid which allows you to collapse and expand sections of the grid by clicking on the nodes. You can create simple outline trees using FlexGrid grouping. For advanced use cases you can build Tree Grids.

    To create a Tree Grid, the C1FlexGrid introduces the concept of Node rows. Node rows do not contain regular data and act as headers under which similar data is grouped, like nodes in a regular TreeView control. They also have a Level property that defines the node hierarchy. Node rows can be collapsed and expanded, hiding or showing the data they contain. 

    For example, suppose you have a grid showing customer and order details. All the information will be there, but it will be hard to see the details of each customer and order.

    In this case, you can create a Tree Grid to group the data in a hierarchical structure for better view and accessibility as shown in the GIF below.

    Image depicting TreeGrid.

    In the upcoming sections, we will walk you through the process of turning a regular grid into a Tree grid by creating node rows.