有没有办法让kendo网格不将时间转换为世界时。例如,我的数据库返回07:00的时间,但是当在网格中显示时,它显示为02:00。如何让列显示您返回的实际时间?
这是Kendo Grid:
@(Html.Kendo().Grid<ExerciseBreakdownViewModel>()
.Name(string.Format("Grid"))
.Columns(columns =>
{
columns.Bound(p => p.Id).Visible(false);
columns.Bound(p => p.PersonnelName).Width(120);
columns.Bound(p => p.NumberOfTeams).Width(120);
columns.Bound(p => p.TeamMembers).Width(110);
columns.Bound(p => p.Vehicles).Width(80);
columns.Bound(p => p.Brief).Format("{0:HH:mm}").EditorTemplateName("BriefTimePicker").Width(80);
columns.Bound(p => p.KickOff).Format("{0:HH:mm}").EditorTemplateName("KickoffTimePicker").Width(80);
columns.Bound(p => p.Debrief).Format("{0:HH:mm}").EditorTemplateName("DebriefTimePicker").Width(80);
})
.Editable(editable => editable.Mode(GridEditMode.InCell))
.HtmlAttributes(new { style = "height:400px;" })
.Navigatable()
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.PageSize(20)
.Events(events => events.Error("error_handler"))
.Model(model =>
{
model.Id(p => p.Id);
model.Field(p => p.PersonnelName).Editable(false);
model.Field(p => p.NumberOfTeams);
model.Field(p => p.TeamMembers);
model.Field(p => p.Vehicles);
model.Field(p => p.Brief);
model.Field(p => p.KickOff);
model.Field(p => p.Debrief);
})
.Read("Personnel_Read", "Schedule", Model)
)
)
从数据库返回的数据是Time类型。调试时,它会在发送到网格的对象中显示正常,但是当网格读取它时,它会转换它。