I have a checkbox in a grid:
columns.Bound(p => p.Display);
I also have the following editor template:
@model Boolean
@Html.Kendo().CheckBoxFor(m => m)
During editing the checkbox editor template does show, however the checked state is always false even when the underlying data is true.
7 Answers, 1 is accepted
In order to change the default editor widget for a field, it is necessary to specify the name of the editor in the model using DataAnnotations UIHint attribute.
e.g.
public
class
YOUR_MODEL
{
...
[UIHint(
"Boolean"
)]
// Boolean is the name of the view that contains the editor
public
bool
Display{
get
;
set
; }
...
}
The following article illustrate illustrates the aforementioned approach step by step:
Regards,
Georgi
Progress Telerik

Sorry I should have mentioned I have already set the UIhint attribute:
[UIHint("Boolean")]
public Boolean Display { get; set; }
If I switch to a standard checkbox (as below) it works fine, so why would the kendo checkbox not work correctly?
@model Boolean
@*@Html.Kendo().CheckBoxFor(m => m)*@
<
div
class
=
"editor-for"
>
@Html.CheckBox("", Model, new { @class = "tickbox-single-line" })
</
div
>
Currently there is an issue that affects the Kendo CheckBox binding when it is used as editor in the Grid component. The developers are aware of this and are doing their best to provide a fix as soon as possible.
Until a fix is available I would suggest using a regular CheckBox. I apologize for any inconvenience this may cause you.
Regards,
Viktor Tachev
Progress Telerik

Is there somewhere I can track the progress on this?
You can track the issue in the following link:
Regards,
Georgi
Progress Telerik

Is it possible that this issue affects not only the CheckBox but also the DatePicker?
I just played around with the Grid control and some other Kendo elements within the grid using Editor Templates.
Ordinary text boxes, numeric text boxes and DropDownLists work fine, but the DatePicker and the CheckBox do not.
In both cases, values disappear when switching into edit mode (InLine).
Furthermore, values get lost when switching back into read mode.
This indicates that bindings obviously do not work in any direction.
Please ensure that the editors are defined as [WidgetName]For. In that case the relevant field in the Model should be bound to the respective editor automatically.
In case the behavior persists please send us a runnable sample where it is replicated so we can examine it.
Regards,
Viktor Tachev
Progress Telerik