I am using the datagrid component with a custom filter, just like in the example https://blazor.radzen.com/datagrid-filter-template.
The problem I have is when I filter through the custom filter I lose the values of the rest of the filter. Any idea how to solve this?
Possible solution will be to use the approach from this article:
Thank you enchev!
Indeed, the clue you sent me allowed me to achieve this with the following code:
public Dictionary<String, String> dicCurrentFiltro(RadzenGrid<Dom_HitoPlantilla> GridHitos) {
Dictionary <String, String> dic = new Dictionary<String, String>();
foreach (RadzenGridColumn<Dom_HitoPlantilla> c in GridHitos.ColumnsCollection) {
if (c.FilterValue != null) {
dic.Add(c.Property, c.FilterValue.ToString());
}
}
return dic;
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
//Aplicamos valores
foreach (RadzenGridColumn<Dom_HitoPlantilla> c in GridHitos.ColumnsCollection)
{
if (DicCurrentFiltro.ContainsKey(c.Property))
{
c.FilterValue = DicCurrentFiltro.GetValueOrDefault(c.Property, null);
}
}
GridHitos.Reload();
}