【发布时间】:2015-03-10 11:26:43
【问题描述】:
我一直在尝试对asp.net mvc webgrid 中的DateTime 列进行排序。
这是我的代码:
grid.Column(header: "Product Purchased Date",columnName:"PurchasedDate" canSort: true,format: @<text>
@item.PurchasedDate.ToString("MM/dd/yyy")</text>
当我尝试使用上面的代码时,我得到了这个错误:
无法从“lambda 表达式”转换为 'System.Func'
System.Web.Helpers.WebGrid.Column(string, string, System.Func, string, bool)' has some invalid arguments 的最佳重载方法匹配。
如果我在不使用 columName 的情况下应用上述代码,我将无法执行排序。
如果我错过了什么,请道歉。
【问题讨论】:
标签: asp.net-mvc-4 datetime webgrid