【问题标题】:Kendo Grid export function changes value of datesKendo Grid 导出功能更改日期值
【发布时间】:2015-08-31 22:27:03
【问题描述】:

我有一个绑定到有效数据源的 MVC Kendo Grid,但是当我尝试使用内置的导出到 excel 功能时,它会下载一个日期不正确的文件。网格显示为“创建日期”18/08/2015,但在 Excel 工作表上显示为 07/07/1905。

我在下面添加了我的网格代码。

Html.Kendo().Grid(Of ******)()
    .Name("grid")
    .Columns(Sub(columns)
        columns.Bound(Function(c) c.ReferenceID).Width(50)                                    
        columns.Bound(Function(c) c.CommentText).Width(150)
        columns.Bound(Function(c) c.DateCreated).Width(150)
            .Format("{0:dd/MM/yyyy}")                                                                       
    End Sub)
    .HtmlAttributes(New With { 
        Key .style = "height: 500px;"                                             
    })
    .Scrollable()
    .Sortable()
    .ToolBar(Function(Toolbar) Toolbar.Excel())
    .Excel(Function(Excelexport)  
        Excelexport.FileName("*****").AllPages(True)
    )
    .Pageable(Function(pageable) pageable.Refresh(True)
    .PageSizes(True).ButtonCount(5))
    .DataSource(Function(dataSource) dataSource.Ajax()
    .PageSize(20).Events(Function(events) 
        events.[Error]("error_handler")
    )
    .Model(Sub(model)
        model.Id(Function(c) c.EncID)
    End Sub)
    .Read(Function(read) 
        read.Action("*****", "*******").Data("********")
    )
)
.Render()

以前有没有人遇到过这个问题,或者对如何让它正确下载有任何建议?

谢谢

【问题讨论】:

    标签: asp.net-mvc vb.net kendo-ui kendo-grid kendo-asp.net-mvc


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 2018-04-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多