【发布时间】:2012-03-29 11:08:41
【问题描述】:
我使用以下 LINQ 创建网格模型:
...
var query = from a in GetUser()
select new UserModel
{
ID = a.ID,
StartDate = a.StartDate,
EndDate = a.EndDate,
StateName = a.State.StateName,
StateID = a.StateID,
City = a.City,
};
return query;
....
HTML 是
@Html.Grid(Model.PagedList).Columns(
col =>
{
col.For(c => c.StateName).Named("State").Attributes(@class => "row").HeaderAttributes(@class => "head");
col.For(c => c.City).Named("City").Attributes(@class => "row").HeaderAttributes(@class => "head");
col.For(c => c.StartDate).Named("Start Date").Attributes(@class => "row").HeaderAttributes(@class => "head");
col.For(c => c.EndDate).Named("End Date").Attributes(@class => "row").HeaderAttributes(@class => "head");
col.For(c => Html.ActionLink("Details", "Details", new { id = c.ID })).Named("View Details").HeaderAttributes(@class => "head").DoNotEncode();
}).Sort(Model.GridSortOptions).Attributes(@class => "grid")
主要问题是如何只显示 DATE 而没有 TIME 部分?
我尝试了一些选项,但在某些情况下我得到了错误,在其他情况下排序 AZ 根本不起作用。
有什么线索吗? 谢谢!!!
【问题讨论】:
标签: asp.net-mvc-3 datetime mvccontrib