I am using telerik grid.
But its not working well. While rendering it is giving me the exception - "Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.."
but if you see following code i am not using any template.
I am using Extensions for ASP.NET MVC Q1 2010.
Is there any way to avoid this?
Following is the code that I am using for grid.
<%=Html.Telerik().Grid(Model)
.Name("Grid")
.DataKeys(keys =>
{
keys.Add(c => c.ID);
})
.Toolbar(commands => commands.Insert())
.DataBinding(dataBinding =>
{
dataBinding.Ajax()
.Select("_SelectAjaxEditing", "Grid")
.Insert("_InsertAjaxEditing", "Grid")
.Update("_SaveAjaxEditing", "Grid")
.Delete("_DeleteAjaxEditing", "Grid");
})
.Columns(columns =>
{
columns.Bound(c => c.Name)
.Width(170);
columns.Bound(c => c.price)
.Width(200);
columns.Command(commands =>
{
commands.Edit();
commands.Delete();
})
.Width(180);
})
.Groupable()
.Pageable()
.Sortable()
%>
<% Html.Telerik().ScriptRegistrar().OnDocumentReady(() =>
{ %>
$('.insert-button').click(function(e)
{
e.preventDefault();
$('#Grid').data('tGrid').createRow();
});
<%
});
%>
Thanks in advance.