This question is locked. New answers and comments are not allowed.
Hi,
I have simple application to showing Notes and its child notes (memo). I am using MVC grid as Master-Detail.
My problem is that the grid loads fine for the parent rows but on expand of it , it doesn;t call the ajax load method/event for some of the rows.
The behavior doesn;t have any specific path or not like that it happen for only specific rows.. it happens for any random parent row.
I dont have any javacript error also.
My View :
I have simple application to showing Notes and its child notes (memo). I am using MVC grid as Master-Detail.
My problem is that the grid loads fine for the parent rows but on expand of it , it doesn;t call the ajax load method/event for some of the rows.
The behavior doesn;t have any specific path or not like that it happen for only specific rows.. it happens for any random parent row.
I dont have any javacript error also.
My View :
<% var NoteListGrid = Html.Telerik().Grid<Hudson.WebApplications.Navigator.IModels.INote>() .DataKeys(datakeys => { datakeys.Add(c => c.Note_Id); }) .Columns(columns => { columns.Bound(e => e.Account_Id).Title("Account#"); columns.Bound(e => e.Account_Service_Id).Title("Service#"); columns.Bound(e => e.Account_Service_Contract_Id).Title("Contract#"); columns.Bound(e => e.CategoryName).Title("Category"); columns.Bound(e => e.DepartmentName).Title("Department"); columns.Bound(e => e.CommunicationType).Title("Communication"); columns.Bound(e => e.Ticket_No).Title("Ticket"); columns.Bound(e => e.EnteredByName).Width(100).Title("Entered By"); columns.Bound(e => e.Created_Date).Format("{0:M/dd/yyyy}").Title("Create Date"); //columns.Bound(e => e.Note_Id).Title("").ClientTemplate("<input type='button' class='new-subnote-icon' onclick = \"HudsonCustomer().AddNoteClick(this,<#=Note_Id #>," + Convert.ToString(ViewBag.Customer_Id) + ",0,0,0);return false;\"/>"); //columns.Bound(e => e.Note_Id).Title("").ClientTemplate("<a href='#' onclick = \"HudsonCustomer().AddNoteClick(this,<#=Note_Id #>," + Convert.ToString(ViewBag.Customer_Id) + ",0,0,0);return false;\">Add Memo</a>"); } ) //.ClientEvents(events => events.OnRowDataBound("notes_onRowDataBound")) .DetailView(details => details.ClientTemplate( Html.Telerik().Grid<Hudson.WebApplications.Navigator.IModels.IMemo>() .Name("Memos") .Columns(columns => { columns.Bound(o => o.MemoId).Width(100); //columns.Bound(o => o.EnteredByName).Title("Entered By").Width(50); //columns.Bound(o => o.Create_Date).Format("{0:M/dd/yyyy}").Title("Create Date").Width (50); //columns.Bound(o => o.CreateDate).Width(100).Format("{0:M/dd/yyyy}").Title("Create Date"); //columns.Bound(o => o.MemoText).Width(250).Title("Note"); }) //.ClientEvents(events => events.OnRowDataBound("memo_onRowDataBound")) .DataBinding(dataBinding => dataBinding.Ajax () .Select("LoadMemoForNote", "Note", new { noteId = "<#=Note_Id#>" })) .Pageable() .Sortable(s => { s.OrderBy(sortOrder => sortOrder.Add(o => o.Create_Date).Descending()); }).Filterable() .Filterable() //.ClientEvents(clientevents => clientevents.OnDataBinding ("OnDataBinding")) .ToHtmlString() )) .DataBinding(dataBinding => dataBinding .Ajax().Select("GetNotes", "Note", new { customerId = (int)ViewBag.Customer_Id, accountId = (int)ViewBag.Account_Id, serviceId = (int)ViewBag.Service_Id, contractId = (int)ViewBag.Contract_Id }) ) .Name("Notes" ) .Resizable(resizing => resizing.Columns(true)) .Sortable(s => { s.OrderBy(sortOrder => sortOrder.Add(e => e.Created_Date).Descending());}).Filterable() .Pageable(pages => pages.PageSize(20)) .Footer(true) .NoRecordsTemplate("There are no Note to display") .ToolBar(commands => { commands.Custom().ButtonType(GridButtonType.Image).HtmlAttributes(new { style="background-image:url(../../Content/Images/new_note.png);", onclick = "HudsonCustomer().AddNoteClick(this,0," + Convert.ToString(ViewBag.Customer_Id) + ",0,0,0);return false;" }); } ) ; NoteListGrid.Render();%>
Controller :
[GridAction]
public ActionResult LoadMemoForNote(int noteId)
{
IMemoList memoList = (IMemoList)DependencyResolver.Current.GetService(typeof(Hudson.WebApplications.Navigator.IModels.IMemoList));
memoList.LoadByNoteId(noteId);
return View(new GridModel(memoList));
}