如何在datagrid中对日期类型列进行排序 [英] How to sort date type column in the datagrid
本文介绍了如何在datagrid中对日期类型列进行排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我有一个数据网格,它有一个日期类型列。问题是它已绑定到数据库中的字符串字段。
因此它根据字符串而不是日期排序。
有谁知道如何正确地将字符串排序为日期。
示例问题如下以下
1/2/2014
12/2/2014
2/12/2014
3/5/2014
谢谢
Hi all,
I got a datagrid which got a date type column. And the problem is it has been binding to a string field in the database.
So it is sorted based on the string not the date.
Does anyone know how can I sort the string as date correctly.
The example issues are as the following
1/2/2014
12/2/2014
2/12/2014
3/5/2014
Thanks
推荐答案
改编自 wpf-datagrid-date-column-by-month [ ^ ]
这篇关于如何在datagrid中对日期类型列进行排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文