This question is locked. New answers and comments are not allowed.
I'm having some trouble with the rendering of an MVC Telerik grid. The grid seems to work fine, but if I include the Delete() command in the Commands column, I get the very first delete command from the first record of the grid showing above the footer, while the rest of the row (and all following rows) show below the footer.
My Telerik grid invocation is:
<%= Html.Telerik().Grid<VideoProjectMemberModel>(Model.Members)
.Name("MembersGrid")
.PrefixUrlParameters(false)
.DataBinding(dataBinding => dataBinding
.Ajax()
.Select("_AjaxBindingMembers", "VideoProjectManager", new { projectId = Model.Id })
.Insert("_AjaxInsertMembers", "VideoProjectManager", new { projectId = Model.Id })
.Delete("_AjaxDeleteMembers", "VideoProjectManager")
.Update("_AjaxDeleteMembers", "VideoProjectManager"))
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText))
.DataKeys(keys => keys.Add(p => p.Id))
.Editable(editing => editing.Mode(GridEditMode.InLine))
.Columns(columns =>
{
columns.Command(commands =>
{
commands.Delete().ButtonType(GridButtonType.ImageAndText);
commands.Edit().ButtonType(GridButtonType.ImageAndText).HtmlAttributes(new { @style = "display:none;" });
}).Width(185).Title("Commands");
columns.Bound(p => p.MemberType).Width(70);
columns.Bound(p => p.UserEmail).Width(345);
columns.Bound(p => p.UserName).Width(200);
columns.Bound(p => p.UserId).HeaderHtmlAttributes(new { @style = "display:none;" }).HtmlAttributes(new { @style = "display:none;" });
columns.Bound(p => p.VideoProjectId).HeaderHtmlAttributes(new { @style = "display:none;" }).HtmlAttributes(new { @style = "display:none;" });
})
.Groupable()
.Pageable(paging => paging.PageSize(50))
.Sortable(sort => sort.OrderBy(sorting => sorting.Add(p => p.UserName).Ascending()))
.Filterable()
.ClientEvents(events=> {
events.OnEdit("onMembersAdd");
})
%>
And what I finally get is what shows in the attached file.
I've already tried these approaches:
Any ideas?
My Telerik grid invocation is:
<%= Html.Telerik().Grid<VideoProjectMemberModel>(Model.Members)
.Name("MembersGrid")
.PrefixUrlParameters(false)
.DataBinding(dataBinding => dataBinding
.Ajax()
.Select("_AjaxBindingMembers", "VideoProjectManager", new { projectId = Model.Id })
.Insert("_AjaxInsertMembers", "VideoProjectManager", new { projectId = Model.Id })
.Delete("_AjaxDeleteMembers", "VideoProjectManager")
.Update("_AjaxDeleteMembers", "VideoProjectManager"))
.ToolBar(commands => commands.Insert().ButtonType(GridButtonType.ImageAndText))
.DataKeys(keys => keys.Add(p => p.Id))
.Editable(editing => editing.Mode(GridEditMode.InLine))
.Columns(columns =>
{
columns.Command(commands =>
{
commands.Delete().ButtonType(GridButtonType.ImageAndText);
commands.Edit().ButtonType(GridButtonType.ImageAndText).HtmlAttributes(new { @style = "display:none;" });
}).Width(185).Title("Commands");
columns.Bound(p => p.MemberType).Width(70);
columns.Bound(p => p.UserEmail).Width(345);
columns.Bound(p => p.UserName).Width(200);
columns.Bound(p => p.UserId).HeaderHtmlAttributes(new { @style = "display:none;" }).HtmlAttributes(new { @style = "display:none;" });
columns.Bound(p => p.VideoProjectId).HeaderHtmlAttributes(new { @style = "display:none;" }).HtmlAttributes(new { @style = "display:none;" });
})
.Groupable()
.Pageable(paging => paging.PageSize(50))
.Sortable(sort => sort.OrderBy(sorting => sorting.Add(p => p.UserName).Ascending()))
.Filterable()
.ClientEvents(events=> {
events.OnEdit("onMembersAdd");
})
%>
And what I finally get is what shows in the attached file.
I've already tried these approaches:
- I've removed the HtmlAttrobutes hiding the Edit command (I hide it because I need the grid to be able to insert new records and delete records, but not edit them; I had to include the column because the Insert and Cancel buttons I use in the Insert operation are rendered in the Edit column). The grid displays with the same error.
- If I remove the Delete command after what I did in step 1, the grid shows fine (so the problem is just with the Delete command, not with any command).
- If I remove all commands, the grid also displays fine.
Any ideas?