I have tried setting up a pivot grid following the demos at http://demos.telerik.com/aspnet-mvc/pivotgrid/local-flat-data-binding and http://demos.telerik.com/aspnet-mvc/pivotgrid/remote-flat-data-binding.
using this model
public
class
FundModel
{
public
string
AssetClass {
get
;
set
; }
public
DateTime ReportDate {
get
;
set
; }
public
decimal
? AssetsStart {
get
;
set
; }
}
and this controller
public
ActionResult TestView()
{
return
View(
// GetAdvisors()
GetFunds()
);
}
private
IEnumerable<FundModel> GetFunds()
{
IEnumerable<FundModel> funds;
using
(var context =
new
EPFRUI_Entities())
{
funds = context.vwDailyFundFlowDetails.Take(300).Select(x =>
new
FundModel
{
AssetClass = x.FundName,
ReportDate = x.ReportDate,
AssetsStart = x.AssetsStart
}).ToList();
}
return
funds;
}
I am passing in my data to this pivot grid based on the demo code
@(Html.Kendo().PivotConfigurator()
.Name(
"configurator"
)
.Height(570)
)
@(Html.Kendo().PivotGrid<FundModel>()
.Name(
"pivotgrid"
)
.Configurator(
"#configurator"
)
.ColumnWidth(120)
.Height(570)
.BindTo(Model)
.DataSource(dataSource => dataSource
.Ajax()
.Schema(schema => schema
.Model(m => m.Field(
"CategoryName"
,
typeof
(
string
)).From(
"Category.CategoryName"
))
.Cube(cube => cube
.Dimensions(dimensions => {
dimensions.Add(model => model.AssetsStart).Caption(
"Assets Start"
);
dimensions.Add(
"CategoryName"
).Caption(
"All Categories"
);
dimensions.Add(model => model.AssetClass).Caption(
"AssetClass"
);
})
.Measures(measures => measures.Add(
"AssetsStart"
).Field(model => model.AssetsStart).AggregateName(
"count"
))
))
.Columns(columns =>
{
columns.Add(
"CategoryName"
).Expand(
true
);
columns.Add(
"AssetClass"
);
})
.Rows(rows => rows.Add(
"AssetClass"
).Expand(
true
))
.Measures(measures => measures.Values(
"Sum"
))
.Events(e => e.Error(
"onError"
))
)
)
Which is getting me a single long line when I run the program and navigate to the view. I have included what shows up in the attached image.
I have also tried setting this up with remote binding and got the same view.
Am I missing an obvious step here? I debugged it and the model has data when the pivot grid is called, and no errors are coming back from the pivotgrid