component ValueChange doenst fire

Hi,

In the SfComboBox component, I used @bind-Value and sometimes I change the data source during execution. Unfortunately, the ValueChange Event does not fire. I use version 23.1.36.


1 Reply

KP Kokila Poovendran Syncfusion Team December 20, 2023 08:17 AM UTC

Hi Sarah,


Greetings from Syncfusion support!


Thank you for reaching out to us with your concern. We understand that you are facing an issue with the ValueChange event not firing when using the @bind-Value property in the SfComboBox component, version 23.1.36.


After thoroughly reviewing your query, we have created a sample using the @bind-Value property and have attempted to replicate the issue on our end. However, we encountered no difficulties in triggering the ValueChange event.


Here is a code snippet for your reference:

 

<SfComboBox TItem="Country" TValue="string" Placeholder="e.g. Australia" @bind-Value="@ComboVal" DataSource="@Countries">

    <ComboBoxFieldSettings Value="Name"></ComboBoxFieldSettings>

    <ComboBoxEvents TItem="Country" TValue="string" ValueChange="@ValueChangeHandler"></ComboBoxEvents>

</SfComboBox>

 

@code {

 

    public string ComboVal = "Austarila";

 

    public class Country

    {

        public string Name { get; set; }

 

        public string Code { get; set; }

    }

 

    List<Country> Countries = new List<Country>

    {

        new Country() { Name = "Australia", Code = "AU" },

        new Country() { Name = "Bermuda", Code = "BM" },

        new Country() { Name = "Canada", Code = "CA" },

        new Country() { Name = "Cameroon", Code = "CM" },

    };

 

    private void ValueChangeHandler(ChangeEventArgs<string, Country> args)

    {

        // Here, you can customize your code.

    }

}


We have also prepared a video illustration for you:





If the issue persists, please provide additional details or steps to help us replicate it on our end. Please modify the sample as per your scenario to replicate the issue at our end so that we can provide you with a prompt solution. We are committed to ensuring that your experience with Syncfusion components is smooth and hassle-free.


Thank you for your understanding.


Regards,

Kokila Poovendran.


Loader.
Up arrow icon