ComponentOne VSFlexGrid 8.0
Step 6: Outlining

The outlining capabilities of the VSFlexGrid control rely on subtotals. When outlining, each subtotal row is treated as a node that can be collapsed or expanded. Nested subtotals are treated as nested nodes. Any rows that are not subtotal rows are treated as branches, which contain detail data.

Because we have already implemented subtotals, adding the outline capabilities is just a matter of adding one more line of code to the Form_Load event handler. The new code sets the OutlineBar property, which displays a tree structure with buttons that the user may click to collapse or expand the outline. Here is what the Form_Load routine should look like by now:

Example Title
Copy Code
    Private Sub Form_Load()

   

        ' initialize the control

        ' …

        ' define some sample data

        ' …

        ' populate the control with the data

        ' …

        ' set up cell merging (all columns)

        ' …

        ' set up outlining

        fg.OutlineBar = flexOutlineBarComplete

        ' organize the data

        ' …

    End Sub

That concludes this demo. Run the project one last time and try clicking on the outline buttons. Clicking will toggle the state of the node between collapsed and expanded. Shift-clicking or ctrl-shift-clicking will set the outline level for the entire control.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback