This question is locked. New answers and comments are not allowed.
Hi All,
I'm trying to bind a checkbox on the client side to a boolean value. I have the code below which works - except the checkbox value is bound to 'true' or 'false' string. Is there a standard way to bind booleans client side to a checkbox?
<%= Html.Telerik().Grid<MyStuff.Accounts>()
.Name("Grid")
.DataKeys(dataKeys => dataKeys.Add(c => c.AccountCode))
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("_AjaxView", "Primary")
)
.Pageable(paging => paging.PageSize(12).Style(GridPagerStyles.NextPreviousAndInput))
.Sortable()
.Columns(columns =>
{
columns.Bound(c => c.LockedOut).ClientTemplate(@"<input type='checkbox' name='cbxLock' value='<#= LockedOut #>' readonly='readonly' />");
columns.Bound(c => c.AccountCode).ReadOnly();
columns.Bound(c => c.UserName);
})
%>
Cheers,
--Sebastian
I'm trying to bind a checkbox on the client side to a boolean value. I have the code below which works - except the checkbox value is bound to 'true' or 'false' string. Is there a standard way to bind booleans client side to a checkbox?
<%= Html.Telerik().Grid<MyStuff.Accounts>()
.Name("Grid")
.DataKeys(dataKeys => dataKeys.Add(c => c.AccountCode))
.DataBinding(dataBinding => dataBinding.Ajax()
.Select("_AjaxView", "Primary")
)
.Pageable(paging => paging.PageSize(12).Style(GridPagerStyles.NextPreviousAndInput))
.Sortable()
.Columns(columns =>
{
columns.Bound(c => c.LockedOut).ClientTemplate(@"<input type='checkbox' name='cbxLock' value='<#= LockedOut #>' readonly='readonly' />");
columns.Bound(c => c.AccountCode).ReadOnly();
columns.Bound(c => c.UserName);
})
%>
Cheers,
--Sebastian