Blazor Tree Grid Example - DynamicObject Binding
ID Press Enter to sort | Project Title Press Enter to sort | Department Press Enter to sort | Start Date Press Enter to sort | End Date Press Enter to sort | Status Press Enter to sort | Priority Press Enter to sort | Budget Press Enter to sort |
|---|---|---|---|---|---|---|---|
| 2112 | Finance Data Lake Buildout | Operations | 1/22/2024 | 3/17/2024 | In Progress | High | $68,187 |
| 2113 | Database Schema Migration | Operations | 1/30/2024 | 2/11/2024 | On Hold | High | $9,950 |
| 2114 | Test Automation Setup | Operations | 1/30/2024 | 2/16/2024 | Completed | Critical | $11,552 |
| 2115 | Performance Tuning | Operations | 2/2/2024 | 2/11/2024 | Initiated | Low | $16,486 |
| 2116 | Security Review | Operations | 2/4/2024 | 2/17/2024 | In Progress | Medium | $18,802 |
| 2117 | ERP Modernization – Procurement | Marketing | 1/29/2024 | 4/3/2024 | Blocked | Critical | $84,932 |
| 2118 | Production Deployment | Marketing | 2/3/2024 | 2/17/2024 | On Hold | Critical | $8,223 |
| 2119 | Post-Go-Live Support | Marketing | 2/6/2024 | 2/24/2024 | Completed | Low | $12,011 |
| 2120 | Training and Enablement | Marketing | 2/12/2024 | 2/21/2024 | Initiated | Medium | $14,567 |
| 2121 | Integration with SSO | Marketing | 2/12/2024 | 2/24/2024 | In Progress | High | $19,429 |
| 2122 | Build CI/CD Pipeline | Marketing | 2/18/2024 | 3/7/2024 | Blocked | Critical | $7,195 |
This sample demonstrates how to bind the Tree Grid to a list of DynamicObject instances, which is useful when the data schema is not defined at compile time. This approach supports core Tree Grid capabilities by resolving members at runtime.
DynamicObject binding can be enabled by assigning a dynamic collection to the Tree Grid's DataSource and exposing runtime members by overriding GetDynamicMemberNames, allowing the Tree Grid to automatically discover columns and perform data operations without requiring a predefined model.
In this demo, the tree column is "Project Title". The Tree Grid supports inline CRUD operations through its toolbar, which includes buttons for Add, Delete, Update, and Cancel. Paging is configured with a page size of two for root items, and a footer aggregate displays the total sum of the "Budget" column.
For more detailed information on DynamicObject binding, please refer to this documentation section.