This question is locked. New answers and comments are not allowed.
Hi,
I am trying to implement Master/Detail Ajax Hierarchy with batch editing on details grid.
And I am trying to use DataTable as a datasource for a child grid.
View looks like this:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<DataTable>" %><%@ Import Namespace="System.Data" %> <% Html.Telerik().Grid<EmployeeTimesheet.Models.Employee>() .Name("EmployeeGrid") .DataBinding(dataBinding => dataBinding.Ajax().Select("GetEmployeeList", "Timesheet")) .DataKeys(d => { d.Add(fk => fk.EmployeeId).RouteKey("EmployeeId"); }) .Columns(columns => { columns.Bound(o => o.EmployeeId); columns.Bound(o => o.FirstName); columns.Bound(o => o.LastName); columns.Bound(o => o.FTE); }) .DetailView(details => details.ClientTemplate( Html.Telerik().Grid(Model) .Name("DailyTimesheetData_<#= EmployeeId #>") .Columns(columns => { columns.Bound("timesheet_data_id"); columns.Bound("timesheet_date"); columns.Bound("start_time"); columns.Bound("end_time"); columns.Bound("lunch_duration"); columns.Bound("hours_worked"); }) .DataKeys(d => { d.Add("timesheet_data_id").RouteKey("timesheet_data_id"); }) .ClientEvents(events => events.OnDataBinding("Grid_onDataBinding").OnError("Grid_onError")) .Editable(editing => editing.Mode(GridEditMode.InCell)) .ToolBar(commands => { commands.SubmitChanges(); }) .DataBinding(dataBinding => dataBinding.Ajax() .Select("GetTimesheetForEmployee", "Timesheet", new { employeeId = "<#= EmployeeId #>" }) .Update("SaveTimesheetChanges", "Timesheet", new { employeeId = "<#= EmployeeId #>" }) ) .ToHtmlString() )) .RowAction(row => row.DetailRow.Expanded = true) .Render(); %>But I am getting an error that “Templates can be used only with field access, property access, single-dimension array index, or single-parameter custom indexer expressions.” for a details.ClientTemplate of a child grid.
But batch editing works only with Ajax Binding, so I don’t have choice but to use Ajax Binding and therefore a ClientTemplate if I want batch editing.
So does that mean you don’t support a DataTable as a datasource for a Master/Details scenario with Ajax Binding?