I have a bool property binded in two way to a dialog checkbox.
if i change the check value, the variabile inside the dialog in binded correctly, but the variable binded in the main component in not updated.
Check this sample, if i set the check and close the dialog, the parent compoent variable is not updated.
https://blazorrepl.telerik.com/ceuZbwah44LSdBQu06
how to solve?
Main.Razor
@if (IsDialogVisible)
{
<CheckDialog @bind-CheckValue="CheckValue" OnClose="() => IsDialogVisible = false" />
}
<p>CheckValue is @CheckValue</p>
@code {
private bool IsDialogVisible {get;set;} = true;
private bool CheckValue {get;set;}
}
CheckDialog.Razor
<TelerikDialog @ref="Dialog" Visible="true" ShowCloseButton="false">
<DialogContent>
<TelerikCheckBox @bind-Value="CheckValue" OnChange="() => Dialog.Refresh()" />
Check test
</DialogContent>
<DialogButtons>
<TelerikButton OnClick="() => OnClose.InvokeAsync()">Close</TelerikButton>
</DialogButtons>
</TelerikDialog>
@code {
private TelerikDialog Dialog {get;set;}
[Parameter]
public bool CheckValue {get;set;}
[Parameter]
public EventCallback<bool> CheckValueChanged {get;set;}
[Parameter]
public EventCallback OnClose {get;set;}
}