This question is locked. New answers and comments are not allowed.
I have a grid like this:
Html.Telerik().Grid<FuseTalk.Core.Domain.Category>(Model)
.Name("Grid")
.HtmlAttributes(new { style = "width:100%; font-size:8pt", id = "commGrid" })
.RowAction(row => { row.HtmlAttributes.Add("class", "communityRow");
row.HtmlAttributes.Add("id", row.DataItem.ID );
}
)
.Columns(columns =>
{
columns.Add(c =>
{%><img src="<%=Url.Content("../../../Content/Images/folder_closed.png") %>" />
<%=Html.ActionLink(c.Description, "Index", "Home", new { id = c.ID }, null)%>
<% }
).Width(200)
.Title("Description");
columns.Add(c =>
{%><img src="<%=Url.Content("../../../Content/Images/feed-icon.gif") %>"/>
<%
}
)
.Title("Feed");
columns.Add(c => c.CategoryStatistics.TopicCount).Title("Topics");
columns.Add(c => c.CategoryStatistics.LastMessageDate).Title("Last Post");
}
)
.ClientEvents(events => events.OnLoad("onLoad").OnDataBinding("onDataBinding").OnRowDataBound("onRowDataBound"))
.Sortable()
.Scrollable(scrolling => scrolling.Height(200))
.Pageable()
.Render()
and then I defined handlers:
Html.Telerik().Grid<FuseTalk.Core.Domain.Category>(Model)
.Name("Grid")
.HtmlAttributes(new { style = "width:100%; font-size:8pt", id = "commGrid" })
.RowAction(row => { row.HtmlAttributes.Add("class", "communityRow");
row.HtmlAttributes.Add("id", row.DataItem.ID );
}
)
.Columns(columns =>
{
columns.Add(c =>
{%><img src="<%=Url.Content("../../../Content/Images/folder_closed.png") %>" />
<%=Html.ActionLink(c.Description, "Index", "Home", new { id = c.ID }, null)%>
<% }
).Width(200)
.Title("Description");
columns.Add(c =>
{%><img src="<%=Url.Content("../../../Content/Images/feed-icon.gif") %>"/>
<%
}
)
.Title("Feed");
columns.Add(c => c.CategoryStatistics.TopicCount).Title("Topics");
columns.Add(c => c.CategoryStatistics.LastMessageDate).Title("Last Post");
}
)
.ClientEvents(events => events.OnLoad("onLoad").OnDataBinding("onDataBinding").OnRowDataBound("onRowDataBound"))
.Sortable()
.Scrollable(scrolling => scrolling.Height(200))
.Pageable()
.Render()
and then I defined handlers:
<script type="text/javascript">
function onLoad(e) { $('ul#editMenu').prepend("<li style='text-align:center; font-weight: bold;'>" + 'Forum options...' + "</li>"); }
function onDataBinding(e) { alert("onDataBinding"); }
function onRowDataBound(e) {alert("onRowDataBound"); var dataItem = e.dataItem; }
</script>
onLoad handler is called but code in onDataBinding and onRowDataBound is not executed. With IE-8 debugger, the break points are not hit whereas it breaks in event handler for onLoad. If I omit the onDataBinding(e) and onRowDataBound(e) event handler altogether then I get exception.