.ToolBar(toolbar => toolbar.Create())
.Editable(editable => editable.Mode(GridEditMode.PopUp).TemplateName("RadioButtonTemplate"))
Add a RadioButton in the RadioButtonTemplate.cshtml template:
@model GridExample.Models.OrderViewModel
@(Html.Kendo().RadioButton().Name("engine1").Checked(true).HtmlAttributes(new { @name = "engine" }).Label("1.4 Petrol, 92kW"))
@(Html.Kendo().RadioButton().Name("engine2").HtmlAttributes(new { @name = "engine" }).Label("1.8 Petrol, 118kW"))
A js exception is thrown and the popup does not open:
Chrome:
Uncaught TypeError: Cannot read properties of undefined (reading 'toString') kendo.all.js:313050
Firefox:
Uncaught TypeError: this.bindings.checked.get() is undefined kendo.all.min.js:10:102181
The issue is reproducible with a RadioButton or a RadioButtonFor helper.
No exception is thrown and the custom popup displays the RadioButton.
When RadioButtonFor Helper is bound to a Model property it does not bind when an editable Grid is placed above its declaration.
public class RadioButtonModel
{
public bool IAgreeProp { get; set; }
}
public class RadioButtonController : Controller
{
public ActionResult RadioButton()
{
RadioButtonModel myModel = new RadioButtonModel() { IAgreeProp = false };
return View(myModel);
}
}
@(Html.Kendo().Grid<GridModel>()
.Name("Collaborators")
...
.Editable(editable => editable.Mode(GridEditMode.InCell))
)
...
@(Html.Kendo().RadioButtonFor(m => m.IAgreeProp).Label("I Agree").Value(true))
@(Html.Kendo().RadioButtonFor(m => m.IAgreeProp).Label("I Disagree").Value(false))
The RadioButtonFor Helper should bind to the specified Model property successfully.
The RadioButton Helper does not bind to the specified Model property successfully.
The RadioButtons are not checked initially. They are only indicated as checked when being clicked.
Reproduction :
https://dojo.telerik.com/ayAXutaJ/8
The radio buttons are not checked initially.
The radio buttons should be checked.