Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

0
Votes

Values assigned to `args.CheckboxListData` in the `CheckboxFilterSearching` handler are not reflected in the UI.


```xml

FilterDialogOpening="OnFilterDialogOpening"

CheckboxFilterSearching="OnCheckboxFilterSearching">

GridEvents>

SfGrid>

```


```cs

public async Task OnFilterDialogOpening(FilterDialogOpeningEventArgs args) {

ItemType[] items = fetchItems(..., args);

args.CheckboxListData = items; // This assignment is reflected in the UX (i.e., the column's Excel-like filter checkbox list)

}


public void OnCheckboxFilterSearching(CheckboxFilterSearchingEventArgs args) {

// `args.CheckboxListData` is null here. I.e., the value assigned to `args.CheckboxListData` in `OnFilterDialogOpening(...)` is not

passed in here.

ItemType[] items = fetchItems(..., args);

args.CheckboxListData = items; // This assignment is not reflected in the UX (i.e., the column's Excel-like filter checkbox list)

// The UX is not updated and furthermore calling StateHasChanged() also doesn't trigger the UX update

}

```


To observe this issue, enter a valid search character in a grid column's filter search box. The checkbox list disappears

and `No Matches Found` is displayed. Adding `StateHasChanged();` as the final line of `OnCheckboxFilterSearching` has no effect. How does one trigger the filter dialog UX to refresh its checkbox list with the values provided via the args.CheckboxListData = items

assignment?



Replication steps

-->Run the attached sample 

-->Then open the filter dialog in the customerID column you will see the issue When searching the column, the CheckboxList data is not showing; instead, it displays 'No matches found.' Additionally, upon clearing the search, the CheckboxList data shows default values instead of the specified CheckboxList data

@page "/"



@using Syncfusion.Blazor.Grids

<SfGrid DataSource="@Orders" @ref="@Grid" TValue="Order" AllowPaging="true" AllowFiltering="true" Toolbar="@(new List<string>() { "Add", "Edit", "Delete", "Cancel", "Update" })" Height="315">

    <GridEditSettings AllowAdding="true" AllowEditing="true" AllowDeleting="true" Mode="EditMode.Normal"></GridEditSettings>

    <GridFilterSettings Type="FilterType.Excel" />

    <GridEvents TValue="Order"
                FilterDialogOpening="OnFilterDialogOpening"
                CheckboxFilterSearching="OnCheckboxFilterSearching">

    </GridEvents>

    <GridColumns>

        <GridColumn Field=@nameof(Order.OrderID) HeaderText="Order ID" IsPrimaryKey="true" ValidationRules="@(new ValidationRules{ Required=true})" TextAlign="TextAlign.Right" Width="120"></GridColumn>

        <GridColumn Field=@nameof(Order.CustomerID) HeaderText="Customer Name" ValidationRules="@(new ValidationRules{ Required=true})" Width="120"></GridColumn>

        <GridColumn Field=@nameof(Order.OrderDate) HeaderText=" Order Date" EditType="EditType.DatePickerEdit" Format="d" TextAlign="TextAlign.Right" Width="130" Type="ColumnType.Date"></GridColumn>

        <GridColumn Field=@nameof(Order.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" EditType="EditType.NumericEdit" Width="120"></GridColumn>

        <GridColumn Field=@nameof(Order.ShipCountry) HeaderText="Ship Country" EditType="EditType.DropDownEdit" Width="150"></GridColumn>

    </GridColumns>

</SfGrid>


@code {

    public SfGrid<Order> Grid { get; set; }

    public List<Order> Orders { get; set; }

    public List<Order> CheckBoxList { get; set; }

    protected override void OnInitialized()

    {

        Orders = Enumerable.Range(1, 75).Select(x => new Order()

            {

                OrderID = 1000 + x,

                CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],

                Freight = 2.1 * x,

                OrderDate = DateTime.Now.AddDays(-x),

                ShipCountry = (new string[] { "USA", "UK", "CHINA", "RUSSIA", "INDIA" })[new Random().Next(5)]

            }).ToList();

        CheckBoxList = Enumerable.Range(1, 75).Select(x => new Order()

            {

                CustomerID = (new string[] { "ZARA", "PRATHAP", "GERBS", "ELISA", "NANCY" })[new Random().Next(5)],

            }).ToList();

    }

    public async Task OnFilterDialogOpening(FilterDialogOpeningEventArgs args)

    {
        if (args.ColumnName == "CustomerID")

        args.CheckboxListData = CheckBoxList;

    }

    public void OnCheckboxFilterSearching(CheckboxFilterSearchingEventArgs args)

    {
        if (args.ColumnName == "CustomerID")
        args.CheckboxListData = CheckBoxList;


    }

    public class Order

    {

        public int? OrderID { get; set; }

        public string CustomerID { get; set; }

        public DateTime? OrderDate { get; set; }

        public double? Freight { get; set; }

        public string ShipCountry { get; set; }

    }

}