I working with the telerik grid a since a few weeks.
It seems that the Bound() Method of the MVC Grid ignores the Type when I write Bound(type, name).
When I have a model binded grid, it works perfectly:
@(Html.Kendo().Grid<Web.Models.Consumption.PDCAModel.PDCAActionplanModel>()
.Name("PDCAActionplanGrid")
.NoRecords(@ResourcesLocal.Resources_Energy_PDCA.NoActionplanAvailable)
.Columns(col =>
{
col.Bound(x => x.PlanCreatedAt).Title(ResourcesLocal.Resources_Energy_PDCA.PlanCreatedAt).Width(200).Format("{0:dd.MM.yyyy}");
col.Bound(x => x.PlanstringTranslated).Title(ResourcesLocal.Resources_Energy_PDCA.Planstring);
})
.Events(e => e.DataBound("PDCAActionplanGrid_DataBound"))
.ClientDetailTemplateId("template")
.DataSource(ds => ds
.Ajax()
.Read(read => read.Action("DataSourcePDCAActionplanGrid", "Consumption"))
)
)
Here my column "PlanCreatedAt" is a datetime which will be shown perfectly.
Now I want to use a dynmic binded grid with a DataTable as DataSource:
@(Html.Kendo().Grid<dynamic>()
.Name("CompilationLogicGrid")
.NoRecords()
.Columns(col =>
{
col.Bound(typeof(DateTime), "Date").Filterable(false).Title(ResourcesGlobal.GlobalResources.Datum).Format("0:dd.MM.yyyy");
})
.Filterable(filtering => filtering.Enabled(true))
.Sortable()
.DataSource(dataSource => dataSource.Ajax()
.Read(read => read.Action("DataSource_CompilationLogicGrid", "Consumption"))
.Sort(x => x.Add("Date").Descending()))
)
There it seems, that the binding will completly ignored. The output is either a plain string which I wrote in the format 0:dd.MM.yyyy or a the plain output of the json response
The JSON Response is on both grids exactly the same: /Date(xxxxxxxxxx)/