Currently we are using dynamic column headers, after the last update the data grid empty template is not triggered anymore because the datagrid thinks it has one item in it. This only happens when the list of columns is empty, if there is a column definition available the amount of items is shown correctly.
is it expected behavior or a bug?
We were on 4.24.3 (nuget source) and update to 4.29.8.
Code example below:
@using RadzenBlazorDemos.Models.Northwind
<h3 class="mt-4">Render without colums, empty template is not shown and item count appears as 1</h3>
<RadzenDataGrid Data="@data"
AllowPaging="true"
ShowPagingSummary="true"
PagerAlwaysVisible="true">
<EmptyTemplate>
<p style="color: lightgrey; font-size: 24px; text-align: center; margin: 2rem;">No records to display.</p>
</EmptyTemplate>
<Columns>
@foreach (var column in @columnData2)
{
<RadzenDataGridColumn Title="@column" Resizable="true">
<Template>
@column
</Template>
</RadzenDataGridColumn>
}
</Columns>
</RadzenDataGrid>
<h3 class="mt-4">Render with colums, empty template appears as expected and item count is 0</h3>
<RadzenDataGrid Data="@data"
AllowPaging="true"
ShowPagingSummary="true"
PagerAlwaysVisible="true">
<EmptyTemplate>
<p style="color: lightgrey; font-size: 24px; text-align: center; margin: 2rem;">No records to display.</p>
</EmptyTemplate>
<Columns>
@foreach (var column in @columnData)
{
<RadzenDataGridColumn Title="@column" Resizable="true">
<Template>
@column
</Template>
</RadzenDataGridColumn>
}
</Columns>
</RadzenDataGrid>
@code {
string emptyText = "No Items to display!";
List<Employee> data = new List<Employee>();
List<string> columnData = new List<string>{
"Test", "Test2"
};
List<string> columnData2 = new List<string>{
};
}