在30天之前更改gridview单元格颜色(来自sql数据库的单元格包含日期)gridview单元格颜色将为红色.i cen not frind任何soloution [英] change gridview cell colour (the cell containt date from sql data base) before 30days the gridview cell colour will be red.i cen not frind any soloution

查看:56
本文介绍了在30天之前更改gridview单元格颜色(来自sql数据库的单元格包含日期)gridview单元格颜色将为红色.i cen not frind任何soloution的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到任何解决方案PLZ帮助我们

i am not find any solution plz help me guys

推荐答案

你确定吗?这里有一些有用的文章。



1. 使用C#和VB.Net在ASP.Net中根据条件动态更改GridView行背景颜色 [ ^ ]

2. 根据C#和VB.Net中的条件动态更改Asp.Net GridView行背景颜色 [ ^ ]
Are you sure? Here are some useful articles.

1. Dynamically change GridView Row Background Color based on condition in ASP.Net using C# and VB.Net[^]
2. Dynamically Change Asp.Net GridView Row Background Color Based on Condition in C# and VB.Net[^]


试试这个.....

try this .....
DateTime today = DateTime.Today.Date;
DateTime expiryDate = Convert.ToDateTime("07/18/2015");

TimeSpan days = expiryDate - today;
double Day = Convert.ToDouble(days.TotalDays);
if (Day < 30)
{
    Label1.ForeColor = System.Drawing.Color.Red;
}
else
{
    Label1.ForeColor = System.Drawing.Color.Green;
}


这篇关于在30天之前更改gridview单元格颜色(来自sql数据库的单元格包含日期)gridview单元格颜色将为红色.i cen not frind任何soloution的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆