I am using the following line to display a grid as part of another view
The below is my grid
@(Html.Telerik().Grid(Model).HtmlAttributes(new { style = "width:700px" })
.Name("ProjectLocations")
.DataKeys(keys =>
{
keys.Add(p => p.ProjectLocationID);
})
.ToolBar(commands => commands.Custom().Text("Add New Location").Action("CreateProjectLocation", "Project", new { projectID = @Model.FirstOrDefault().ProjectID}))
.DataBinding(dataBinding => dataBinding.Server()
.Update("EditProjectLocation", "Project", new { mode = mode, type = type })
.Delete("DeleteProjectLocation", "Project", new { projectID = @Model.FirstOrDefault().ProjectID }))
.Columns(columns =>
{
columns.Command(commands =>
{
commands.Custom("Edit").ButtonType(type).Action("EditProjectLocation", "Project", new { projectID = @Model.FirstOrDefault().ProjectID }).ImageHtmlAttributes(new { @class = "t-icon t-edit" });
commands.Delete().ButtonType(type);
}).Width("35%").Title("Commands");
columns.Bound(p => p.Location.ShortName).Width("50%").Title("Location");
columns.Bound(p => p.PrimaryLocation).Title("Primary").HtmlAttributes(new { style = "text-align:center" });
})
.Editable(editing => editing.Mode(mode))
.Sortable()
.Pageable())
Now this is how this grid is rendered, which causes some of the columns to look funny ... notice how the <div id="ProjectLocations"> is closed way too early:
Any help is greatly appreciated :)