Hi,
I'm looking for some guidance on the best way to pivot data that is being returned from a .NET MVC controller. I'm able to read it into the regular grid by doing the following :
@(Html.Kendo().Grid<Project.Models.viewMyModel>()
.Name("grid")
.ToolBar(tools => tools.Excel())
.Columns(columns =>
{
columns.Bound(p => p.Field1).Width("auto");
columns.Bound(p => p.Field2).Width("auto");
columns.Bound(p => p.Field3).Width("auto");
columns.Bound(p => p.Field4).Width("auto");
})
.Excel(excel => excel
.FileName("Report1.xlsx")
.ProxyURL("Report?handler=Save")
.AllPages(true)
)
.Height(550)
.AutoBind(false)
.Pageable()
.Sortable()
.Scrollable()
.Resizable(r => r.Columns(true))
.Filterable()
.DataSource(dataSource => dataSource
.Ajax()
.Read(read => read.Action("GetSummary", "Reports").Data("getParams"))
.PageSize(100)
.ServerOperation(false)
)
.Events(ev => ev.ExcelExport("onExcelExport"))
.NoRecords(n => n.TemplateId("no-records-template-id"))
)
The form post submits some date parameters to the 'GetSummary' controller and returns the json data source for the grid.
I would like to pivot these results so that Field1 results are my column headers and the other fields are my rows. Would PivotGrid be a good option or is that overkill? If so - I wasn't sure how to get it to read the json results as as I did with the grid above. Or would you suggest I pivot/manipulate the data beforehand and continue to read with the traditional grid method?
Thanks,
Adam