如何根据asp.net c#sql中的表列状态更改gridview行forecolor [英] How to change gridview rows forecolor based on table column status in asp.net c# sql

查看:49
本文介绍了如何根据asp.net c#sql中的表列状态更改gridview行forecolor的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在我的网页上使用asp.net c#,Sqlserver 2005



我有Gridview的数据填写它。



在我的数据库表中,我有一个列名称状态。在状态中它有0和1作为状态,



如果Status = 1 Gridview行Forecolor必须更改为红色。

其他

如果状态= 0,则保留以前的颜色。



请帮助我。

这是在pageload本身时完成的。



谢谢。

Hi All,
am using asp.net c#, Sqlserver 2005

on my webpage I have Gridview with data fill in it.

In My database table I have a column Name Status in it. In Status it has 0 and 1 as Status,

If the Status = 1 the Gridview row Forecolor Must change to Red color.
else
if the Status = 0 leave as previous color.

Please can you help me.
This is to be done when pageload itself.

Thanks.

推荐答案

检查以下链接



http://stackoverflow.com/questions/1793570/set-gridview-value-itemstyle-forecolor-based-on-row-column-value [ ^ ]



http://stackoverflow.com/questions/4546487/how-can-i-change-column-fore-color-in-datagridview-as-per-condition [<一个HREF =http://stackoverflow.com/questions/4546487/ how-can-i-change-column-fore-color-in-datagridview-as-condition-ascondition =_ blanktitle =New Window> ^ ]





希望我理解你的答案是正确的。
Check the below links

http://stackoverflow.com/questions/1793570/set-gridview-value-itemstyle-forecolor-based-on-row-column-value[^]

http://stackoverflow.com/questions/4546487/how-can-i-change-column-fore-color-in-datagridview-as-per-condition[^]


Hope I have understood your answer correct.


这篇关于如何根据asp.net c#sql中的表列状态更改gridview行forecolor的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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