This question is locked. New answers and comments are not allowed.
Hi All,
I am using following code to have a checkbox in Grid but somehow getting error.Is it correct code to have checkbox in grid.
Plz reply.
Error getting runtime:
Code Of Grid:
<%
Html.Telerik().Grid<User>(Model.Data)
.Name("relationsGris")
.Columns(columns =>
{
columns.Add(x => x.Username).Title("User Name");
columns.Add(x => x.Name).Title("Name");
columns.Add(x=> {%>
<%=Html.CheckBox("ttt",x.IsCustomer)%>
<%});
columns.Add(x => x.Id).Format
(
string.Format("<form action=\"{0}\" method=\"post\">", Url.Action("Delete", new { userIdentificationId = "{0}" })) +
Html.CarsAndCargo().LinkButton().Class("icon delete").SubmitFormOnClick(false).ToString() +
"</form>"
)
.Encoded(false).Title(" ").Filterable(false).Sortable(false);
})
.Sortable()
.Ajax(ajax => ajax.Action("AjaxGridBinding", "UserIdentification"))
.Render();
%>
Thanks.
I am using following code to have a checkbox in Grid but somehow getting error.Is it correct code to have checkbox in grid.
Plz reply.
Error getting runtime:
Cannot use templates in Ajax or WebService binding mode
Code Of Grid:
<%
Html.Telerik().Grid<User>(Model.Data)
.Name("relationsGris")
.Columns(columns =>
{
columns.Add(x => x.Username).Title("User Name");
columns.Add(x => x.Name).Title("Name");
columns.Add(x=> {%>
<%=Html.CheckBox("ttt",x.IsCustomer)%>
<%});
columns.Add(x => x.Id).Format
(
string.Format("<form action=\"{0}\" method=\"post\">", Url.Action("Delete", new { userIdentificationId = "{0}" })) +
Html.CarsAndCargo().LinkButton().Class("icon delete").SubmitFormOnClick(false).ToString() +
"</form>"
)
.Encoded(false).Title(" ").Filterable(false).Sortable(false);
})
.Sortable()
.Ajax(ajax => ajax.Action("AjaxGridBinding", "UserIdentification"))
.Render();
%>
Thanks.