This is a migrated thread and some comments may be shown as answers.

Getting Exception in Ajax Binding

1 Answer 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Makarand Salvi
Top achievements
Rank 1
Makarand Salvi asked on 07 Mar 2010, 05:31 AM

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.

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 08 Mar 2010, 08:23 AM
Hi Makarand Salvi,

Please check this forum thread.

Regards,
Atanas Korchev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Grid
Asked by
Makarand Salvi
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or