We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Checkbox not getting the correct value

Thread ID:

Created:

Updated:

Platform:

Replies:

150393 Jan 5,2020 02:17 PM UTC Jan 8,2020 07:30 AM UTC Blazor 1
loading
Tags: Checkbox
Tsvetan
Asked On January 5, 2020 02:17 PM UTC

Hello,

We have a component that uses the EjsCheckBox and sets it like this 

<EjsCheckBox @bind-Checked="Value"
                         Label="@Label"></EjsCheckBox>


The value comes from a parameter:

    private bool _value;
    [Parameter]
    public bool Value
    {
        get => _value;
        set
        {
            if (_value != value)
            {
                _value = value;
                ValueChanged.InvokeAsync(value);
            }
        }
    }

For some reason the Value is true, but the EjsCheckBox is not displaying it as Checked. 
This is a functionality that worked for sure in a previous version of Syncfusion. The version that we are currently using is 17.4.40

Kind Regards,
Tsvetan

Saranya Dhayalan [Syncfusion]
Replied On January 8, 2020 07:30 AM UTC

Hi Tsvetan 
 
Thank you for contacting Syncfusion support 
 
We have checked your reported issue. We are not able to reproduce it in our end. We have set the value is true in the button click event, checkbox is displaying it as checked. Please find the below code snippet: 
 
@using Syncfusion.EJ2.Blazor.Buttons 
 
<EjsCheckBox @bind-Checked="@Value" 
             Label="@Label"></EjsCheckBox> 
<br /> 
<button @onclick="btnclick">Click</button> 
 
@code  { 
 
    public string Label { get; set; } 
    private bool _value; 
    [Parameter] 
    public EventCallback<string> ValueChanged { get; set; } 
    [Parameter] 
    public bool Value 
    { 
        get => _value; 
        set 
        { 
            if (_value != value) 
            { 
                _value = value; 
                ValueChanged.InvokeAsync(value.ToString()); 
            } 
        } 
    } 
 
    public void btnclick() 
    { 
        Value = true; 
    } 
} 
 
For your convenience we have prepared a sample. Please find the below sample link: 
 
 
Could you please check whether your issue is resolved in the attached sample, if not please replicate the issue in the attached sample and get back to us, we will provide a better solution quickly. 
 
Regards, 
Saranya D 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon