Home | Feedback | Login

CSS for Gridview

This link explains CSS for gridivew. 

 <asp:GridViewID="gvTerritories"

runat="server"CssClass="gridview"AutoGenerateSelectButton="True"GridLines="None"AllowPaging="true"PageSize="10"><HeaderStyleCssClass="gridViewHeader"/><RowStyleCssClass="gridViewRow"/><AlternatingRowStyleCssClass="gridViewAltRow"/><SelectedRowStyleCssClass="gridViewSelectedRow"/><PagerStyleCssClass="gridViewPager"/></asp:GridView>

.gridview {

    font-family:Arial;

    background-color:#FFFFFF;

    border: solid 1px#CCCCCC;}.gridview td  {

    padding:5px50px5px5px;}.gridview th {

    padding:5px50px5px5px;

    text-align: left;}.gridview th a{

    color:#003300;

    text-decoration: none;}.gridview th a:hover{

    color:#003300;

    text-decoration: underline;}.gridview td a{

    color:#003300;

    text-decoration: none;}.gridview td a:hover {

    color: red;

    text-decoration:underline;}.gridViewHeader {

    background-color:#0066CC;

    color:#FFFFFF;

    text-align: left;}.gridViewRow {

    background-color:#99CCFF;

    color:#000000;}.gridViewAltRow {

    background-color:#FFFFFF;}.gridViewSelectedRow {

    background-color:#FFCC00;

    color:#666666;}/* Of course, this doesn't work with IE6. Works fine with Firefox, though. */.gridview tr.gridViewRow:hover td,.gridview tr.gridViewAltRow:hover td {

    background-color:#CCCCCC;

    color:#000000; }.gridViewPager 

{

    background-color:#0066CC;

    color:#FFFFFF;

    text-align: left;}.gridViewPager td  {

    padding:3px;}.gridViewPager td a {

    color:#FFFFFF;

    text-decoration: none;}.gridViewPager td a:hover {

    color:#FFFFFF;

    text-decoration: underline;}/* The currently selected page number is rendered by ASP.NET in a span tag in the td. */.gridViewPager span {

    color:#000000;}#divGridView {

    margin-top:1.5em;}