c# - How to compare two dates in same DataGridView column
问题描述
How to compare dates in one DataGridView
column. I use for loop to do this, but no luck.
for (int i = 0; i < dgv.Rows.Count; i++)
{
DateTime currDate = Convert.ToDateTime(dgv.Rows[i].Cells["End Date"].Value);
//index[0] > index[1]
//2020-04-04 2020-04-10
if (currDate > currDate)
{
MessageBox.Show("In Progress");
}
}
解决方案
推荐阅读
- javascript - 单击引导程序 4 中的切换按钮后,值未返回
- javascript - 无法访问 Javascript 数组中的元素
- javascript - Google Script - 从下拉列表中发送电子邮件
- javascript - 有没有什么方法可以使 html 表单中禁用字段的数据不显示在下载的 txt 文件中?
- javascript - 在这种情况下 return computerPick[randomPick] 做什么?
- c# - C#如何使用switch语句在多维数组中设置列?
- django - 仅使用模型中一个对象的主键将 Django HTML 模板呈现为 PDF
- mongodb - 在 mongodb 中跟进
- c# - 查找与给定路径对应的 Blazor 组件类
- javascript - Vue:使用链接设置初始数据字符串