Is it possible to implement a drill-down view in SfGrid for two or more levels through DetailTemplate?
Answer:
<SfGrid DataSource="@Employees"> <GridTemplates> <DetailTemplate> @{ var employee = (context as EmployeeData); <SfGrid TValue="Order" Query="@GetEmployeesQuery(employee)" AllowPaging="true"> <GridPageSettings PageSize="8">GridPageSettings> <SfDataManager Url="https://js.syncfusion.com/demos/ejservices/Wcf/Northwind.svc/Orders" CrossDomain="true">SfDataManager> <GridTemplates> <DetailTemplate Context="CustomerContext"> @{ var orders = (CustomerContext as Order); <SfGrid TValue="CustomerDetails" Query="@GetOrderQuery(orders)"> <SfDataManager Url="https://js.syncfusion.com/demos/ejservices/Wcf/Northwind.svc/Customers" CrossDomain="true">SfDataManager> . . . SfGrid> } DetailTemplate> GridTemplates> <GridColumns> <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="110"> GridColumn> . . . GridColumns> SfGrid> } DetailTemplate> GridTemplates> <GridColumns> <GridColumn Field=@nameof(EmployeeData.EmployeeID) HeaderText="Employee ID" TextAlign="TextAlign.Right" Width="110"> GridColumn> . . . GridColumns> SfGrid> |
You can get the sample from here.
Reference:
https://blazor.syncfusion.com/documentation/datagrid/row/#rendering-custom-component
https://blazor.syncfusion.com/demos/datagrid/hierarchy-grid?theme=bootstrap4
- 0 Reply
- 1 Participant
-
SS Syncfusion Support
- Dec 3, 2020 01:03 PM UTC
- Jul 13, 2021 06:29 AM UTC