From 896e4979bd97c19a03bce532b7132893cf19a247 Mon Sep 17 00:00:00 2001 From: Peace Date: Fri, 28 Jun 2024 11:21:41 +0900 Subject: [PATCH] datagrid virtualization --- .../Components/Pages/DataGridREST.razor | 38 +++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/ComponentPractice/ComponentPractice/Components/Pages/DataGridREST.razor b/ComponentPractice/ComponentPractice/Components/Pages/DataGridREST.razor index 65fa325..617a8d3 100644 --- a/ComponentPractice/ComponentPractice/Components/Pages/DataGridREST.razor +++ b/ComponentPractice/ComponentPractice/Components/Pages/DataGridREST.razor @@ -11,9 +11,9 @@ + SelectionMode="DataGridSelectionMode.Single" + AllowPaging="true" PageSize="@PAGE_SIZE" PagerHorizontalAlign="HorizontalAlign.Center" ShowPagingSummary="true" + AllowFiltering="true" AllowColumnResize="true" AllowAlternatingRows="false" FilterMode="FilterMode.CheckBoxList" AllowSorting="true"> @@ -29,6 +29,29 @@ + + DataGrid Virtualization + + + + + + + + + + + + + + + + + + @code { readonly int PAGE_SIZE = 10; @@ -68,4 +91,13 @@ isLoading = false; } + + // Virtualization + IEnumerable vtzdCustomers; + + protected override async Task OnInitializedAsync() + { + var result = await service.GetCustomer(); + vtzdCustomers = result.Value; + } }