Greetings!
I'm trying to create an "Hybrid Filter" it should have a row with manual filtering and the other rows should have the automatic Radzen filter
Im trying to achieve this trough LoadData
async Task OnDataGridLoadData(LoadDataArgs args)
{
// Get the full dataset
IEnumerable<ObraModel> filteredData = Enumerable.Empty<ObraModel>();
// Check if there's a filter applied to the manually filtered column
if (args.Filters.Any(f => f.Property == "Situacao"))
{
// Apply custom filtering for the specific column
var manualFilter = args.Filters.FirstOrDefault(f => f.Property == "Situacao");
if (manualFilter != null)
{
// // Example of applying manual filtering (adjust as necessary for your logic)
// var filterValue = manualFilter.Value?.ToString();
// filteredData = filteredData.Where(item => item.YourManualFilteredProperty.Contains(filterValue));
filteredData = await getFilteredWorkshets("Situacao", "N");
}
// Remove the manual filter from the default filtering logic to avoid double filtering
args.Filters = args.Filters.Where(f => f.Property != "Situacao").ToList();
}
// Apply the default filtering for other columns using Radzen’s built-in logic
//filteredData = Radzen.Filter.Apply(filteredData, args.Filters);
// Pagination and sorting
filteredData = filteredData.Skip(args.Skip.Value).Take(args.Top.Value).ToList();
// Pagination
obrasList = filteredData;
count = filteredData.Count();
//await InvokeAsync(StateHasChanged);
}
I tried this but it is not working for me
How could i do this?