如何在dd-mm-yyyy格式中仅在gridview中显示日期部分 [英] how to show only date part in gridview in dd-mm-yyyy format
本文介绍了如何在dd-mm-yyyy格式中仅在gridview中显示日期部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在网格视图中,我使用的是dataformatstring {0:dd-MM-yyy}
,但它并不适用于我使用它的所有表单。它在2-3页上显示正确的结果10
In grid view I am using dataformatstring{0:dd-MM-yyy}
but it is not working on all forms where i have used it. it is showing correct result on 2-3 pages out 10
推荐答案
绑定网格时
使用
while binding the grid
use
<%# Eval("startTime", "{0:dd MMM yyyy}")%>
检查以下链接以获取不同选项:
http://www.c-sharpcorner。 com /论坛/主题/ 71720 / how-to-display-datetime-in-gridview-in-format-mmddyyyy.aspx [ ^ ]
check the following link for different options:
http://www.c-sharpcorner.com/Forums/Thread/71720/how-to-display-datetime-in-gridview-in-format-mmddyyyy.aspx[^]
在数据绑定方法中使用string.split c#
喜欢
Hi,
Use string.split in databinding method in c#
like
res.dt.rows[0][4].tostring().split(" ");
我们知道数据库中的日期格式是12-34-1999 12:00:11 PM
我们打破数据和时间我们根据我们的要求使用日期。
另一种方法是使用eval(网格视图中的功能
正如我之前所说。
]]>
我跳你明白我说的话。
We know already to date format in database is 12-34-1999 12:00:11PM
thn we break that data and time we use date as per our requirement .
And another method is using eval() function in grid view
as I said in earlier.
]]>
I hop you understand what i said.
这篇关于如何在dd-mm-yyyy格式中仅在gridview中显示日期部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文