No sender member in CheckedChanged event

Hello,
This is true for nearly every arguments' events. This should be great if we could have the sender for each event argument.
Brice.

4 Replies

SD Saranya Dhayalan Syncfusion Team May 26, 2020 10:48 AM UTC

Hi Brice, 
 
Thank you for contacting Syncfusion support 
 
We have checked your query, we would like to let you know the following details 
 
1.       Please confirm whether you need the reference of the component in event argument. 
2.       Please share more details about 'sender member'. 
 
Please provide the above requested information, based on that we will check and provide you a better solution quickly. 
 
Regards, 
Saranya D 



BF Brice FROMENTIN May 26, 2020 03:08 PM UTC

Hello,

I often used two-way databinding for values, but I implement sometimes behaviours on the sender on some event.This means that without the sender I need to create on event handler for each instance of the component instead of one for all.

I hope I be clearer.

Brice.


SD Saranya Dhayalan Syncfusion Team May 27, 2020 02:04 PM UTC

Hi Brice,  
 
We have checked your reported query, we suspect that you want to get the property of the component in the ValueChange event. In the below code snippet, we have send the label property into the ValueChange event. Please find the below code snippet: 
 
@using Syncfusion.Blazor.Buttons 
 
<SfCheckBox Label="@label" ValueChange="@((Syncfusion.Blazor.Buttons.ChangeEventArgs e)=>valueChange(e, label))"></SfCheckBox> 
 
@code{ 
 
    public string label { get; set; } = "Checkebox"; 
 
    public void valueChange(Syncfusion.Blazor.Buttons.ChangeEventArgs e, string label) 
    { 
        this.label =  label + "Changed"; 
    } 
} 
 
We do not have any method in checkbox component, only for calling the method we need the component reference, so in which case you need the checkbox reference as an extra argument in ValueChange event and also share your exact use case 
 
Could you please check the code snippet and let us know whether this is fulfilling your requirement, if not please share your exact use case scenario. So, that we can analyze based on that and provide you a better solution. The information provided would be great help for us to proceed further. 
 
Regards, 
Saranya D 
 



BF Brice FROMENTIN May 28, 2020 07:19 PM UTC

Hello,

Imagine that I generate dynamically those checkbox, the @label binding would be useless and requires more complicated code.

Regards,

Brice.

Loader.
Up arrow icon