设置gridview标题颜色 [英] setting gridview header color

查看:286
本文介绍了设置gridview标题颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在asp.net和c#
工作,我有一个网格视图。我在该网格视图中有10列。我有一些网格视图标题文字颜色的问题。
某些列标题有链接(用于排序)。这些标题文本的颜色是浅蓝色。点击蓝色后,将颜色更改为另一种颜色。



某些列标题没有链接。这种标题文本的颜色是灰色的。

我想将整个标题文本的颜色设置为单一颜色,如灰色。点击链接后,它必须是相同的颜色。
提前致谢

解决方案

您可以在css文件中定义css类。定义你的类后,你可以用你的类名来设置你的网格CssClass属性。例如;

  .GridStyle 
{
border:6px solid rgb(217,231,255 );
背景颜色:白色;
font-family:arial;
font-size:12px;
border-collapse:collapse;
margin-bottom:0px;
}
.GridStyle tr
{
border:1px solid rgb(217,231,255);
颜色:黑色;
height:25px;

您的网格标题栏样式* /
.GridStyle th
{
background-color:rgb(217,231,255);
border:none;
text-align:left;
font-weight:bold;
font-size:15px;
padding:4px;
颜色:黑色;
}
/ *您的网格标题链接样式* /
.GridStyle tr th a .GridStyle tr a a:visited
{
color:Black;
}
.GridStyle tr th,.GridStyle tr td table tr td
{
border:none;
}

.GridStyle td
{
border-bottom:1px solid rgb(217,231,255);
padding:2px;
}


i am working in asp.net and c# i have a grid view. i have 10 columns in that grid view. I have some problems with grid view header text color. some of the columns header have link (for sorting). the color of such header text is a light blue.after clicking the blue color change to another color.

some of columns header does not have link. the color of such header text is gray.

i want to make the color of entire header text to single color like gray. after clicking the link it must be in same color. thanks in advance

解决方案

You may define css class in your css file. After defined your class, you may set your grid CssClass property with your class name. For ex.;

.GridStyle
{
    border: 6px solid rgb(217, 231, 255);
    background-color: White;
    font-family: arial;
    font-size: 12px;
    border-collapse: collapse;
    margin-bottom: 0px;
}
.GridStyle tr
{
    border: 1px solid rgb(217, 231, 255);
    color: Black;
    height: 25px;
}
/* Your grid header column style */
.GridStyle th
{
    background-color: rgb(217, 231, 255);
    border: none;
    text-align: left;
    font-weight: bold;
    font-size: 15px;
    padding: 4px;
    color:Black;
}
/* Your grid header link style */
.GridStyle tr th a,.GridStyle tr th a:visited
{
        color:Black;
}
.GridStyle tr th, .GridStyle tr td table tr td
{
    border: none;
}

.GridStyle td
{
    border-bottom: 1px solid rgb(217, 231, 255);
    padding: 2px;
}

这篇关于设置gridview标题颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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