Skip to content

Commit

Permalink
DataGridFooterTotals demo improved
Browse files Browse the repository at this point in the history
  • Loading branch information
enchev committed Aug 17, 2023
1 parent b1819ff commit a212382
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions RadzenBlazorDemos/Pages/DataGridFooterTotals.razor
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
<Columns>
<RadzenDataGridColumn Width="60px" TItem="Order" Title="#" Filterable="false" Sortable="false" TextAlign="TextAlign.Center">
<Template>
<RenderOnceComponent CanRender=@(!(index >= ordersGrid.PageSize))>
@{
ResetIndex(index >= ordersGrid.PageSize);
}
@((ordersGrid.CurrentPage * ordersGrid.PageSize) + index++ + 1)
</RenderOnceComponent>
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="Order" Property="OrderID" Title="Order ID">
Expand Down
16 changes: 16 additions & 0 deletions RadzenBlazorDemos/Shared/RenderOnceComponent.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@inherits RadzenComponentWithChildren
@ChildContent
@code {
public override async Task SetParametersAsync(ParameterView parameters)
{
if (parameters.GetValueOrDefault<bool>(nameof(CanRender)))
{
await base.SetParametersAsync(parameters);
}

await Task.CompletedTask;
}

[Parameter]
public bool CanRender { get; set; }
}

0 comments on commit a212382

Please sign in to comment.