protected override async Task OnParametersSetAsync() { guests = await GuestRepo.GetAll().ToListAsync(); Action <IGridColumnCollection <GuestEntity> > columns = c => { c.Add(g => g.Username).Titled(Loc["Username"]); c.Add(g => g.AccessExpiration).Titled(Loc["AccessExpiration"]).SetFilterWidgetType("DateTimeLocal").Format("{0:dd/MM/yyyy HH:mm}"); c.Add(g => g.AllowedAddresses).Titled(Loc["AllowedAddresses"]); }; var query = new QueryDictionary <StringValues>(); query.Add("grid-page", "1"); var client = new GridClient <GuestEntity>(q => GetGridRows(columns, q), query, false, "guestsGrid", columns, CultureInfo.CurrentCulture) .Sortable() .Filterable() .WithMultipleFilters() .SetKeyboard(true) .Selectable(true, false, false); grid = client.Grid; // Try to set a previous filter if (VolatileSettings.GridQueries.ContainsKey((0, "guestsGrid"))) { grid.Query = VolatileSettings.GridQueries[(0, "guestsGrid")];
private async Task RefreshList() { guests = await GuestRepo.GetAll().ToListAsync(); await gridComponent.UpdateGrid(); StateHasChanged(); }