I've made a Grid that formerly got his data from the Model.
I also had a custom collumn here that i created using columns.template which worked properly.
For sorting and search reasons a changed the datasource to a json from a viewmodel.
When i used this method my data also loaded but the template only displayed an empty column.
This is my code of the Grid:
@(Html.Kendo().Grid<KdG.ProjectPortofolio.IntranetApp.ViewModels.Projects.ListProjectViewModel>()
.Name("Grid")
.DataSource(ds => ds.Ajax()
.Read(r => r.Action("Read", "Project"))
)
.EnableCustomBinding(false)
.ToolBar(toolBar => toolBar.Custom()
.Text("Exporteer naar Excel")
.HtmlAttributes(new { @class = "export",@id="test" })
.Url(Url.Action("ExportToExcel", "Project",new { page = 1, pageSize = "~", filter = "~", sort = "~" }))
)
.Columns(columns =>
{
columns.Bound(p => p.Name).Filterable(filterable => filterable.UI("nameFilter")).Title("Naam");
columns.Bound(p => p.Status).Filterable(filterable => filterable.UI("statusFilter")).Title("Status");
columns.Bound(p => p.Category).Title("Categorie");
columns.Bound(p => p.StartDate).Title("Start");
columns.Bound(p => p.EndDate).Title("Einde");
columns.Bound(p => p.AreaOfStudy).Title("Studiegebied");
columns.Bound(p => p.ProjectLeader).Title("Projectleider");
columns.Template(
@<text>
@Html.IconActionLink("glyphicon glyphicon-info-sign", null, "Details", "Project", new { id = item.Id }, new { @class = "btn btn-default btn-xs float FloatLeft" })
</text>);
})
.Filterable(f => f.Extra(false).Operators(o => o.ForString(s => s
.Clear()
.Contains("Bevat")
.DoesNotContain("Bevat Niet")
.EndsWith("Eindigd met")
)))
.Pageable()
.Groupable()
.Sortable()//Enable paging
)
Thanks in advance
I also had a custom collumn here that i created using columns.template which worked properly.
For sorting and search reasons a changed the datasource to a json from a viewmodel.
When i used this method my data also loaded but the template only displayed an empty column.
This is my code of the Grid:
@(Html.Kendo().Grid<KdG.ProjectPortofolio.IntranetApp.ViewModels.Projects.ListProjectViewModel>()
.Name("Grid")
.DataSource(ds => ds.Ajax()
.Read(r => r.Action("Read", "Project"))
)
.EnableCustomBinding(false)
.ToolBar(toolBar => toolBar.Custom()
.Text("Exporteer naar Excel")
.HtmlAttributes(new { @class = "export",@id="test" })
.Url(Url.Action("ExportToExcel", "Project",new { page = 1, pageSize = "~", filter = "~", sort = "~" }))
)
.Columns(columns =>
{
columns.Bound(p => p.Name).Filterable(filterable => filterable.UI("nameFilter")).Title("Naam");
columns.Bound(p => p.Status).Filterable(filterable => filterable.UI("statusFilter")).Title("Status");
columns.Bound(p => p.Category).Title("Categorie");
columns.Bound(p => p.StartDate).Title("Start");
columns.Bound(p => p.EndDate).Title("Einde");
columns.Bound(p => p.AreaOfStudy).Title("Studiegebied");
columns.Bound(p => p.ProjectLeader).Title("Projectleider");
columns.Template(
@<text>
@Html.IconActionLink("glyphicon glyphicon-info-sign", null, "Details", "Project", new { id = item.Id }, new { @class = "btn btn-default btn-xs float FloatLeft" })
</text>);
})
.Filterable(f => f.Extra(false).Operators(o => o.ForString(s => s
.Clear()
.Contains("Bevat")
.DoesNotContain("Bevat Niet")
.EndsWith("Eindigd met")
)))
.Pageable()
.Groupable()
.Sortable()//Enable paging
)
Thanks in advance