Link to home
Start Free TrialLog in
Avatar of sticar
sticar

asked on

DataGrid CSS Style?

I just need a style for my datagrids... but all I'm getting is an all white background and black CG-Times letters.  What I need is:
Header: Background=Gainsboro
            Forecolor = 000086
            Bold
Body:    Background=White
            Forecolor=000086
Footer:  Same as header

Font = Arial

Here is what I have
-------------------------------------
.grid{
     font-size:     10pt;
     color: #000086;
     background-color: White;
}

/* DataGrid header */
.grid_header{
     color: Gainsboro;
     background-color: #000086;
     border-color:Gainsboro;
}

/* DataGrid items */
.grid_item{
     background-color: white;
     color: #000086;
}

/* DataGrid alternate items */
.grid_altitem{
     background-color: white;
     color: #000086;
     border-color:Gainsboro;
}
     
/* DataGrid alternate items */
.grid_selitem{
     background-color: #000086;
     color: #000086;
     border-color:Gainsboro;
}

<TD height="303"><asp:datagrid id="dgGrid" runat="server" Width="899px" GridLines="Vertical" AllowPaging="True"
            PageSize="8" AllowCustomPaging="True" AutoGenerateColumns="False" CellPadding="4" BorderWidth="1px" BorderStyle="None" CssClass="grid">
      <SelectedItemStyle Font-Bold="True" CssClass="grid_selitem"></SelectedItemStyle>
      <AlternatingItemStyle CssClass="grid_altitem"></AlternatingItemStyle>
      <ItemStyle CssClass="grid_item"></ItemStyle>
      <HeaderStyle CssClass="grid_header"></HeaderStyle>
      <FooterStyle CssClass="grid_header"></FooterStyle>
Avatar of rama_krishna580
rama_krishna580
Flag of United States of America image

Avatar of Volkan Vardar
Volkan Vardar

do you use css file or put this code in aspx?
ASKER CERTIFIED SOLUTION
Avatar of Volkan Vardar
Volkan Vardar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sticar

ASKER

I feel like such a dork!  I was messing with this page trying to get a user control to work and I had stripped out the header information... I didn't think to look at it again, because it did change the color to white when I added the style to it!

Thanks!