How to format date in mvc web grid

前端 未结 4 1462
滥情空心
滥情空心 2021-02-05 11:03

I have a web grid and I am not using razor syntex.Rather I am using the .aspx form. the code is below;

<%
    var grid = new WebGrid(Model,defaultSort:\"Publi         


        
4条回答
  •  爱一瞬间的悲伤
    2021-02-05 11:17

    This works for me, and allows for Null values

    grid.Column("End_Date",format: item => ((item.End_Date == null) ? "" : item.End_Date.ToString("MM/dd/yyyy"))),
    

提交回复
热议问题