I can't read the checkedValue of the radiobutton, also ValueChange do not work.
I append also a simple testproject. How can read the checked value ?
Hi Michael,
We have validated your reported query and prepared the sample based on your requirement. please refer the below code snippet and attached sample. we need to set TChecked property for radio button two-way bind-checked feature.
|
<SfRadioButton Label="Unspecified" Name="status" TChecked="string" Value="Unspecified" @bind-Checked="@CheckedValue" CssClass="e-primary" ValueChange="OnValueChange"></SfRadioButton> …………………………………………………………… private void OnValueChange(ChangeArgs<string> args) { var Selected_item = args.Value; } |
Could you please check the above code and get back to us, if you need any further assistance on this.
Regards,
YuvanShankar A
OnValueChange ist never called and the 2 way binding also not work. Here my complete sample:
Sorry your sample WORK !
I have to find out what's the difference to my sample code maybe because I also have an OnClicked handler which I dont need if OnValueChange work,
Thanks YuvanShankar m you can close it. Problem solved.
I have another problem with SfRadiobutton, I must override the css because my radio buttons are placed on a dark background and the default label color (text) is black, that css code is already in my sample. But with that the disable state don't work anymore. Do you know what I have to do in css to have the label color (text) gray or more opaque if the radiobutton have:
<SfRadioButton Label="Dismissed" Name="status" TChecked="string" Value="Dismissed" @bind-Checked="@CheckedValue" CssClass="e-primary" ValueChange="OnValueChange" Disabled="true" ></SfRadioButton>
Hi Michael,
We have checked your reported query and please use the below CSS code to achieve your requirement.
|
.e-radio:disabled + label .e-label { color: gray !important; } |
Please get back to us if you need further assistance on this.
Regards,
Yuvan Shankar A
That solved it ! Great thanks.
You are welcome, Michael. We are happy to hear that your requirement has been fulfilled. Please get back to us if you need any further assistance on this.