I have a hierarchical grid, using MVC, and in the detail (child) table, I want the user to be able to create a new row and the row will contain an Autocomplete field. I have everything wired up, the grid displays correctly, with data. When the user clicks Add New Record, a new row is displayed with the Autocomplete field. However, for some reason, no data is being retrieved from the server (the controller method isn't getting called at all) when the user starts typing. Here is the code for the autocomplete editor and the detail table:
@(Html.Kendo().AutoComplete()
.Name("Combined")
.ValuePrimitive(true)
.DataTextField("Combined")
.Filter("contains")
.MinLength(3)
.HtmlAttributes(new { style = "width:200px" })
.DataSource(source =>
{
source.Read(read =>
{
read.Action("GetAntiqueCategories", "Customer");
})
.ServerFiltering(false);
})
)
<script id="template" type="text/kendo-tmpl">
@(Html.Kendo().Grid<Entities.AntiqueCategory>()
.Name("grid_#=RowId#")
.Columns(columns =>
{
columns.Bound(o => o.Combined).EditorTemplateName("Combined");
columns.Command(command => { command.Destroy(); }).Width(200);
})
.ToolBar(toolbar =>
{
toolbar.Create();
toolbar.Save();
})
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(10)
.Model(model => model.Id(p => p.RowId))
.Read(read => read.Action("ReadCustomerWantDetail", "Customer", new { customerId = "#=RowId#" }))
.Create(update => update.Action("CreateCustomerWantDetail", "Customer", new { customerId = "#=RowId#" }))
.Update(update => update.Action("CreateCustomerWantDetail", "Customer", new { customerId = "#=RowId#" }))
.Destroy(update => update.Action("DeleteCustomerWantDetail", "Customer"))
)
.Editable(editable => editable.Mode(GridEditMode.InCell))
.Pageable()
.Sortable()
.ToClientTemplate()
)
</script>