CS1503 Argument 2: cannot convert from 'method group' to 'EventCallback'

Hello everybody.

I am trying to implement ValueChange event of sfNumericTextBox. But the complier throws design time error which suggest that there is mismatch my method and its argument. I have checked and recheck but I cannot find any error in my code. 


Below is code block throwing the error and my method

<div class="col-6">


                            <SfNumericTextBox @bind-Value="@QuantityBought"
                                                Placeholder="Quantity"
                                                TValue="double?"
                                                FloatLabelType="FloatLabelType.Auto"
                                                Enabled="true"
                                                TabIndex="5">


                                                <NumericTextBoxEvents TValue="double?" ValueChange="@QuantityChangeHandler"></NumericTextBoxEvents>


                                            </SfNumericTextBox>
                        </div>





 public double? QuantityBought { get; set; }


        public void QuantityChangeHandler(ChangeEventArgs<double?> args)
        {
            //....
        }



Thanks for the usual prompt response

1 Reply 1 reply marked as answer

DA Dineshkumar Arumugam Syncfusion Team January 6, 2022 01:10 PM UTC

Hi Paul ! 
Greeting from Syncfusion support ! 
We have validated your issue, we have suggested you to use the below code snippet to get rid of the reported issue, we suspect that the native change event argument may be wired with our ValueChange event handler, so please use our Syncfusion namespace change event argument as shown in the below code snippet. 
[Index.razor
<SfNumericTextBox @bind-Value="@QuantityBought" 
            Placeholder="Quantity" 
            TValue="double?" 
            FloatLabelType="FloatLabelType.Auto" 
            Enabled="true" 
            TabIndex="5"> 
            <NumericTextBoxEvents TValue="double?" ValueChange="@QuantityChangeHandler"></NumericTextBoxEvents> 
</SfNumericTextBox> 
 
@code { 
 
     public double? QuantityBought { get; set; } 
 
 
        public void QuantityChangeHandler(Syncfusion.Blazor.Inputs.ChangeEventArgs<double?> args) 
        { 
            //.... 
        } 
} 
 
 
If you still facing the issue, please get back to us with below details. 
  1. Simple sample with issue reproducing steps.
  2. Is there any customization done from your end ?
 
Regards, 
Dineshkumar A.

Marked as answer
Loader.
Up arrow icon