Hello,
I followed every step like the mvc examples to try to bind a list view.
My setup is as follows:
The Controller:
The Model:
The view:
This is practically the same as in the example.
But it doesn't display data.
The resultset from "return Json(GetScans().ToDataSourceResult(request));" does contain the dataset.
What am I doing wrong here...!
Thanks,
I followed every step like the mvc examples to try to bind a list view.
My setup is as follows:
The Controller:
public
ActionResult Scans_Read([DataSourceRequest] DataSourceRequest request)
{
return
Json(GetScans().ToDataSourceResult(request));
}
private
static
IEnumerable<ScanModel> GetScans()
{
var ec =
new
entityContext();
return
ec.tScan.Select(scanmodel =>
new
ScanModel
{
scanId = scanmodel.scanId,
description = scanmodel.description,
directoryPath = scanmodel.directoryPath
});
}
public
class
ScanModel
{
[ScaffoldColumn(
false
)]
public
int
scanId
{
get
;
set
;
}
[Required]
[DisplayName(
"description"
)]
public
string
description
{
get
;
set
;
}
[Required]
[DisplayName(
"directoryPath"
)]
public
string
directoryPath
{
get
;
set
;
}
}
@model IEnumerable<
ns.Models.ScanModel
>
<
script
type
=
"text/x-kendo-tmpl"
id
=
"template"
>
<
div
class
=
"scanmodel"
>
<
h3
>#:description#</
h3
>
</
div
>
</
script
>
@(Html.Kendo().ListView<
ns.Models.ScanModel
>(Model)
.Name("listView")
.TagName("div")
.ClientTemplateId("template")
.DataSource(dataSource => {
dataSource.Read(read => read.Action("Scans_Read", "CustomerPortal"));
})
)
But it doesn't display data.
The resultset from "return Json(GetScans().ToDataSourceResult(request));" does contain the dataset.
What am I doing wrong here...!
Thanks,