protected override async Task OnAfterRenderAsync()
{
AuditEntries = await _context.AuditEntries
.ToListAsync();
}
The debugger shows me that in both scenarios, the AuditEntries list is fully populated. In Scenario 1 the grid works fine, in Scenario 2 the grid displays "No Records".
This really does not make sense!
<style>
.e-emptyrow{
display: none
}
</style> |
protected override async Task OnAfterRenderAsync()
{
AuditEntries = await _context.AuditEntries
.ToListAsync();
gridData = defaultGrid.DataSource = AuditEntries;
defaultGrid.DataBind();
} |
Hi Andrew,Greetings from Syncfusion support.By default, Grid shows “No records to display” message at the initial loading. Once getting data from the server(or local) then we have remove this message and bind data to grid this is the default behavior.While using asynchronous function (await operator) and it take considerable to get the data from server so that it shows “No records to display” message in Grid. If you don’t want to show this message then we suggest you to use the below way to hide the message.
<style>.e-emptyrow{display: none}</style>If this message is not removed at all, even asynchronous call completed, then please use the following highlighted code changes to reflect data source changes on grid.
protected override async Task OnAfterRenderAsync(){AuditEntries = await _context.AuditEntries.ToListAsync();gridData = defaultGrid.DataSource = AuditEntries;defaultGrid.DataBind();}Regards,Thavasianand S.
<EjsGrid DataSource="@Orders" AllowPaging="true">
<GridPageSettings PageSize="5"></GridPageSettings>
<GridColumns>
. . . . .
</GridColumns>
</EjsGrid>
@code{
public List<Order> Orders { get; set; }
protected override async Task OnInitializedAsync()
{
Orders = await OrderData.GetOrders();
}
} |