如何更改数据网格回地面的颜色 [英] How to change the datagrid back ground color

查看:88
本文介绍了如何更改数据网格回地面的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用.NET 2005

Using .Net 2005

我改变默认的单元格样式的后台行颜色(白色到蓝色)。但蓝色显示的是不是所有的行。

i change the background row color in default cell style (white to blue). But blue is displaying not all the rows.

替代行显示为白色。我要显示所有行作为一个相同的颜色。

Alternative row is appearing as white. I want to display all the rows as a same color.

任何一个可以帮我做的。

Can any one help me to do.

推荐答案

你可以设置GridView的行背景颜色像这样

Hi you can set gridview row background color like this

protected void gridview _RowDataBound(object sender, GridViewRowEventArgs e)
{
      if (e.Row.RowType == DataControlRowType.DataRow)
      {  e.Row.BackColor = System.Drawing.Color.Blue;  }
}

这篇关于如何更改数据网格回地面的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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