Hello,
I have tried the new RadzenDataGrid component that comes with the 3.30 version with the AllowVirtualization="true" atribute and it does not work properly with custom filtering.
In this screenshot I am using a custom active filter that works perfectly fine with the old RadzenGrid component and pagination. In this case after switching on the active filter, it does not filter anything, but once I use the scroll it applies the filter. In my switch component I have a grid.Reload() function on change event. This is the code that I am using:
<RadzenDataGrid AllowVirtualization="true" @ref="grid0" EmptyText="No se hallaron resultados" Count="@count" LoadData="@LoadData" FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive" Style="width: calc(100vw - 300px);height: calc(100vh - 320px)" ColumnWidth="128px" AllowFiltering="true" AllowSorting="true" Data="@getCabeceraPedidoClientesResult" FilterMode="FilterMode.Simple" TItem="ConfiguracionFalRadzen.Models.Fal.CabeceraPedidoCliente" RowSelect="@Grid0RowSelect">
<Columns>
<RadzenDataGridColumn TItem="ConfiguracionFalRadzen.Models.Fal.CabeceraPedidoCliente" Filterable="true" Sortable="false" TextAlign="TextAlign.Center" Width="70px" Title="Activo">
<FilterTemplate>
<div class="h-100">
<AcimutSwitch @bind-value="(FiltroActivo)" Change="@(()=> { grid0.Reload();StateHasChanged(); })" />
</div>
</FilterTemplate>
</RadzenDataGridColumn>
.
.
.
</Columns>
</RadzenDataGrid>
The custom filtering also does not work properly with the dropdown that is shown in the right. This is my @LoadData function:
protected async Task LoadData(LoadDataArgs args)
{
var query = await Fal.FalGetCabeceraPedidoClientes(new Query() { OrderBy = "e => e.FechaPedido" });
if (!string.IsNullOrEmpty(args.Filter))
{
query = query.Where(args.Filter);
}
if (!string.IsNullOrEmpty(args.OrderBy))
{
query = query.OrderBy(args.OrderBy);
}
if (FiltroActivo)
{
query = query.Where(e => e.PedidosEnCursos.FirstOrDefault().Activo);
}
if (FiltroActividad!=null)
{
query = query.Where(e=> Convert.ToInt32(e.IS_TipoActividad)==FiltroActividad);
}
if (FiltroEstado!=null)
{
query = query.Where(e=>Convert.ToInt32(e.Estado)==FiltroEstado);
}
count = query.Count();
getCabeceraPedidoClientesResult = query.Skip(args.Skip.Value).Take(args.Top.Value).ToList();
await InvokeAsync(StateHasChanged);
}
I have found another problem with the RadzenDataGrid. In your examples, in the page https://blazor.radzen.com/datagrid-simple-filter if you use the Date filter, the date is not shown in the filter box so you can not know the date that you have selected. Furthermore, if you contract the sidebar menu this happens:
Thank you.