Reputation: 13
I started experimenting with devexpress Blazor Grid component for a project that we are migrating from Webforms to Blazor WebAssembly.
I see the pagination component in the grid works really fine.
But I have this requirement to load all records without pagination and kind of struggling to get the right settings
<DxDataGrid DataAsync="@GetEmployeeStatssAsync" WIDTH="700px" VerticalScrollBarMode="ScrollBarMode.Auto"
VerticalScrollableHeight="200">
<DxDataGridColumn Field="@nameof(EmployeeStatResponse.FullName)" Width="30px" />
<DxDataGridColumn Field="@nameof(EmployeeStatResponse.Batches)" Width="30px" />
<DxDataGridColumn Field="@nameof(EmployeeStatResponse.Lines)" Width="20px" />
<DxDataGridColumn Field="@nameof(EmployeeStatResponse.Units)" Width="20px" />
<DxDataGridColumn Field="@nameof(EmployeeStatResponse.Hours)" Width="30px" />
<DxDataGridColumn Field="@nameof(EmployeeStatResponse.LPH)" Width="30px" />
<DxDataGridColumn Field="@nameof(EmployeeStatResponse.Errors)" Width="30px" />
<DxDataGridColumn Field="@nameof(EmployeeStatResponse.EPer)" Width="30px" />
</DxDataGrid>
I tried by setting the pagesize as 10,000, But when I do that the screen freezes.
<DxDataGrid DataAsync="@GetEmployeeStatssAsync(51)" WIDTH="700px" PageSize="10000"
VerticalScrollBarMode="ScrollBarMode.Auto"
VerticalScrollableHeight="200">
Please let me know what is the correct wat to implement
Thank you in advance.
Upvotes: 0
Views: 868
Reputation: 13
you can use the ShowPager, PagerAllDataRowsItemVisible, PageSize properties for DxDataGrid
<DxDataGrid Data="@employees" ShowPager="false" PagerAllDataRowsItemVisible="false" PageSize="10000">
<DxDataGridColumn Field="Id" AllowSort="false" Width="50px"/>
<DxDataGridColumn Field="Name" AllowSort="false" Width="50px"/>
<DxDataGridColumn Field="PhoneNumber" AllowSort="false" Width="50px"/>
</DxDataGrid>
Upvotes: 0