This question is locked. New answers and comments are not allowed.
The onrowdatabound even doesn't fire. I do not get any javascript error either, and I have bound the grid using Ajax databinding. Here is thecode. Please help me as I am majorly stuck on this.
The grid renders correctly though.
Thanks,
Anthony
//Code
@{
Html.Telerik().Grid(Model.Specialities)
.Name("Specialities")
.Columns(columns =>
{
columns.Bound(o => o.ServiceName).Title("Specialty");
columns.Bound(o => o.IsAssociatedSpeciality).Title("Associated With Problem")
.ClientTemplate("<input type='checkbox' name='associatedSpecialty' <#= IsAssociatedSpeciality ? 'checked' : ''#> />");
columns.Bound(o => o.IsCommonDiagnosis).Title("Common Problem")
.ClientTemplate("<input type='checkbox' name='commonSpecialty' value='<# IsCommonDiagnosis #>' />");
})
.DataBinding(dataBinding => dataBinding.Ajax().Select("ManageAssociatedSpecialities", "Diagnosis"))
.ClientEvents(events => events.OnRowDataBound("onRowDataBoundSpecialties"))
.Footer(false)
.Render();
}
//Javascript code
function onRowDataBoundSpecialties(e) {
alert("called");
if (e.row.cells[1].innerHTML == "true") {
e.row.cells[1].attr("disabled", false);
e.row.cells[2].attr("disabled", false);
}
else {
e.row.cells[2].attr("disabled", true);
}
}
The grid renders correctly though.
Thanks,
Anthony
//Code
@{
Html.Telerik().Grid(Model.Specialities)
.Name("Specialities")
.Columns(columns =>
{
columns.Bound(o => o.ServiceName).Title("Specialty");
columns.Bound(o => o.IsAssociatedSpeciality).Title("Associated With Problem")
.ClientTemplate("<input type='checkbox' name='associatedSpecialty' <#= IsAssociatedSpeciality ? 'checked' : ''#> />");
columns.Bound(o => o.IsCommonDiagnosis).Title("Common Problem")
.ClientTemplate("<input type='checkbox' name='commonSpecialty' value='<# IsCommonDiagnosis #>' />");
})
.DataBinding(dataBinding => dataBinding.Ajax().Select("ManageAssociatedSpecialities", "Diagnosis"))
.ClientEvents(events => events.OnRowDataBound("onRowDataBoundSpecialties"))
.Footer(false)
.Render();
}
//Javascript code
function onRowDataBoundSpecialties(e) {
alert("called");
if (e.row.cells[1].innerHTML == "true") {
e.row.cells[1].attr("disabled", false);
e.row.cells[2].attr("disabled", false);
}
else {
e.row.cells[2].attr("disabled", true);
}
}