function click11()
{
o = document.getElementById("DataGrid1");
for(i=0;i<o.rows.length;i++)
{
if(!(o.rows[i].style.backgroundColor!="#CCCCCC"))
{
alert(i);
}
}
}
这是意思就是返加DataGrid中背景色为#CCCCCC的记录数
为什么有但判断不成功呢
{
o = document.getElementById("DataGrid1");
for(i=0;i<o.rows.length;i++)
{
if(!(o.rows[i].style.backgroundColor!="#CCCCCC"))
{
alert(i);
}
}
}
这是意思就是返加DataGrid中背景色为#CCCCCC的记录数
为什么有但判断不成功呢
这里后面不能用 "#CCCCCC"
而要用 系统已知的颜色名,比如:white black..你这里应该是 gray=======请参考======
public override System.String ToString ( )
System.Drawing.Color 的成员摘要:
将此 System.Drawing.Color 结构转换为可读的字符串。 返回值:
如果 System.Drawing.Color 结构是使用 FromName 方法或 FromKnownColor 方法从预定义颜色创建的,则作为此 System.Drawing.Color 结构的颜色名称的字符串;否则将是由 ARGB 分量名称及其值组成的字符串。 ====CSDN 小助手 V2.5 2005年11月05日发布====
CSDN小助手是一款脱离浏览器也可以访问Csdn论坛的软件
速度快,使用方便。
界面:http://blog.csdn.net/Qqwwee_Com/archive/2005/11/05/523395.aspx
下载:http://szlawbook.com/csdnv2
this.Text1.BackColor ="gray";
{
var childs = document.getElementById("DataGrid1").rows;
for(var i=1;i<childs.length;i++)
{
var child = childs[i];
if(child.style.backgroundColor=='#CCCCCC')
{
var tds = child.children;
alert(i);
}
}
}
if判断之前
alert(o.rows[i].style.backgroundColor);
弹出看看,是个小写
Text1.BackColor = color;