Tree grid
TreeGridControlA flat list with Id and ParentId columns, shown as a collapsible hierarchy.
Overview
TreeGridControl builds the hierarchy from two property names on a flat list: IdMapping names the key and
ParentIdMapping the parent key, null or empty for a root. TreatAsParent marks rows as expandable even
before their children are in the list, TreeColumnIndex picks the column that carries the indentation and icons, NodeExpandIconStyle is
PlusMinus or Triangle, EnableCollapseAll starts with every node collapsed, and
ToggleOnRowClick="false" limits toggling to the icon. Expanded and Collapsed report the node
and its level; ExpandAllAsync and CollapseAllAsync do the same from code.
Examples
#Divisions and their phases
Each division is a root row and its phases are children, all in one flat list. Click a plus to open a division, or use Expand all. Change the size to rebuild the list with more divisions and phases; the line under the grid counts the rows the grid received and names the last node you opened or closed.
| Division and phase | Phases | Budget |
|---|---|---|
| 0100 - General Requirements (Division 1) | 4 | $121,598.79 |
| 0200 - Existing Site Conditions (Division 2) | 4 | $96,728.26 |
| 0300 - Concrete Foundations (Division 3) | 4 | $66,815.88 |
| 0400 - Masonry & Stonework (Division 4) | 4 | $78,704.07 |
| 0500 - Metals & Structural Steel (Division 5) | 4 | $84,834.04 |
| 0600 - Wood, Plastics & Composites (Division 6) | 4 | $99,656.68 |
| 0700 - Thermal & Moisture Protection (Division 7) | 4 | $94,423.98 |
| 0800 - Openings (Doors & Windows) (Division 8) | 4 | $84,244.71 |
| 0900 - Finishes & Drywall (Division 9) | 4 | $80,964.65 |
| 1000 - Specialties & Accessories (Division 10) | 4 | $122,402.95 |
50 rows: 10 divisions with 4 phases each
Documentation
TreeGridControl (92 parameters), TreeGridColumn and TreeNodeEventArgs are still to be written up from Grid/TreeGridControl.razor.cs and Grid/TreeGridColumn.cs.