Quickgrid with Virtualize=true not displaying the data.
- Dominant language
- C#
- Stars
- 38.4k
- Forks
- 10.9k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 276
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
Trying to use QuickGrid with Virtualize = true using Data from a List.
Followed the sample provided in https://aspnet.github.io/quickgridsamples/virtualizing
The grid header is displayed and the number of items is displayed correct. But, the grid data is is not displayed/empty.
### Expected Behavior
Expect to see the sample data in the list to be displayed in the grid with virtualize feature.
printing result.TotalItemCount to check if the items are in itemProvider and the count looks correct. just the grid data is not displayed.
What am I missing?
### Steps To Reproduce
```
@page "/virtualize"
@using News.Shared;
@using Microsoft.AspNetCore.Components.QuickGrid
Total: @numResults stories received
@code {
QuickGrid? grid;
GridItemsProvider? itemsProvider;
int numResults;
protected override void OnInitialized()
{
itemsProvider = async request =>
{
var data = News.Shared.Data.Stories;
var result = GridItemsProviderResult.From(
items: data,
totalItemCount: data.Count);
if (result.TotalItemCount != numResults && !request.CancellationToken.IsCancellationRequested)
{
numResults = result.TotalItemCount;
StateHasChanged();
}
return result;
};
}
==========================================================
Sample data -
namespace News.Shared
{
public static class Data
{
public static List Stories = StoriesData();
public static List StoriesData()
{
Stories = new List();
Stories.Add(new StoryPOC { Time = DateTime.Now, Service = "DJN", File = "4222", Headline = "Test 1" });
Stories.Add(new StoryPOC { Time = DateTime.Now, Service = "TKR", File = "8789", Headline = "Test 2" });
Stories.Add(new StoryPOC { Time = DateTime.Now, Service = "DJN", File = "4223", Headline = "Test 3" });
Stories.Add(new StoryPOC { Time = DateTime.Now, Service = "LOC", File = "4105", Headline = "Test 4" });
Stories.Add(new StoryPOC { Time = DateTime.Now, Service = "TKR", File = "4107", Headline = "Test 5" });
return Stories;
}
}
}
---------------------------------------------------------
public class StoryPOC
{
public string DocId { get; set; }
public DateTime Time { get; set; }
public string? File { get; set; }
public string? Service { get; set; }
public string? Headline { get; set; }
}
```
### Exceptions (if any)
_No response_
### .NET Version
8.0.1
### Anything else?
Attached screenshot with the developer tool open. you can see the table data section is empty.

Contributor guide
Assessment
This issue has not been assessed yet.