如何在gridview绑定时根据条件变色 RT 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 RowDataBound事件中if (e.Row.RowType == DataControlRowType.DataRow) { if (e.Row.Cells[0].Text == "1") { e.Row.BackColor = System.Drawing.Color.Red; } else { e.Row.BackColor = System.Drawing.Color.Blue; } }如果数据空中的值为"null",那么就用 来进行判断( 代表IE中的5个字符或者半角的空格(?)) 行变色吗?行变色见下面代码。 /// <summary> /// GridViewRow行背景色 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void GVTransitJob_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#C0C0FF';this.style.color='buttontext';this.style.cursor='default';"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='';this.style.color='';"); } } 说清楚点是WEB还是WIN可以在RowDataBound事件里面做 textbox的封装方法 程序找不到使用 EXEC sp_executesql @SQL 返回的结果集 VS.net如何将网页保存为模版页? 新手问个相当简单的问题,如何得到当前目录? 关于byte[]的转换 textbox的简单问题,超简单, 发布C#需要哪些DLL文件? 我想用C#发手机短信,目前哪个短信平台发送质量好,支持得好,价格优惠 这个linq语句怎么写? 关于今天是今年的第几个星期的代码. 如何通过图片识别数据 将树结构转换成xml文件
{
if (e.Row.Cells[0].Text == "1")
{
e.Row.BackColor = System.Drawing.Color.Red;
}
else
{
e.Row.BackColor = System.Drawing.Color.Blue;
}
}如果数据空中的值为"null",那么就用 来进行判断( 代表IE中的5个字符或者半角的空格(?))
/// <summary>
/// GridViewRow行背景色
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void GVTransitJob_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#C0C0FF';this.style.color='buttontext';this.style.cursor='default';");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='';this.style.color='';");
}
}
是WEB还是WIN可以在RowDataBound事件里面做