Hiding div when checkbox lciked

Hello,
I have a checkbox and a div.
I want the div to hide/show when the value of the checkbox change. But it does not work.
Can you help me?
It has to be on the change value, not on click.
Thank you


<SfCheckBox Label="est accompagné" @bind-Checked="@(rendezVous.Patient.EstAccompagne)" @onchange="@Show"></SfCheckBox>
                    <div hidden= "@IsShow"> show</div>

@code {
private bool IsShow {get;set;} = false;
private void Show()
{
//do other stuff and then hide or show
IsShow = !IsShow;
}
}

1 Reply 1 reply marked as answer

AS Aravinthan Seetharaman Syncfusion Team April 7, 2021 06:37 AM UTC

 
Thanks for contacting Syncfusion Support. 
 
We have checked your query in our latest version 19.1.0.55. We cannot reproduce your reported issue in our end. For your reference we have prepared code snippet and sample here. 
 
 
@using Syncfusion.Blazor.Buttons 
 
<SfCheckBox @bind-Checked="isChecked" Label="est accompagné" @onchange="onChange"></SfCheckBox> 
 
<div hidden="@IsShow"> show</div> 
 
@code { 
    private bool isChecked { get; set; } = true; 
    private bool IsShow { get; set; } = false; 
    private void onChange() 
    { 
        IsShow = !IsShow; 
    } 
} 
 
 
 
If you are still facing the issue, kindly share the below details. 
 
·        Please share us the Syncfusion Package Version. 
·        If possible, try to reproduce the reported issue in provided sample. 
·        Please share us the video demonstration of this issue. 
 
Please provide the above requested information, based on that we will check and provide you a better solution quickly. 
 
Regards, 
Aravinthan S 


Marked as answer
Loader.
Up arrow icon