Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor Radzen hybrid Datagrid filter

$
0
0

I'm trying to create an "Hybrid Filter" it should have a row with manual filtering and the other rows should have the default Advanced Mode Radzen filterIm trying to achieve this trough LoadData

How could i do this?I'm really stuck on this one

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 meI can only filter through "my" filter and radzen doesn't seem to filter the rows without my custom filter


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>