Home All Groups Group Topic Archive Search About

Datagrid HeaderStyle.CssClass applied to <tr>

Author
13 Feb 2007 4:07 PM
Randel
Hi.

I am building a datagrid based on a datatable.  I am attempting to
apply a style value using the syntax
Datagrid.HeaderStyle.CssClass="mystyle".

When the datagrid renders, the style is applied at the row level
(example below)
<tr class="mystyle" align="Left" valign="Top">
<td>Name</td><td>City</td><td>Begin Date</td><td>Category</
td><td>Calendar</td></tr>

I need it to apply at the column level
<tr align="Left" valign="Top">
<td class="mystyle">Name</td><td class="mystyle">City</td><td
class="mystyle">Begin Date</td><td class="mystyle">Category</td><td
class="mystyle">Calendar</td></tr>

I can't figure this out.  Can you help?

Thanks.  Randy

Author
14 Feb 2007 8:03 AM
marss
Randel wrote:
Show quoteHide quote
> Hi.
>
> I am building a datagrid based on a datatable.  I am attempting to
> apply a style value using the syntax
> Datagrid.HeaderStyle.CssClass="mystyle".
>
> When the datagrid renders, the style is applied at the row level
> (example below)
> <tr class="mystyle" align="Left" valign="Top">
> <td>Name</td><td>City</td><td>Begin Date</td><td>Category</
> td><td>Calendar</td></tr>
>
> I need it to apply at the column level
> <tr align="Left" valign="Top">
> <td class="mystyle">Name</td><td class="mystyle">City</td><td
> class="mystyle">Begin Date</td><td class="mystyle">Category</td><td
> class="mystyle">Calendar</td></tr>
>
> I can't figure this out.  Can you help?
>
> Thanks.  Randy

Hi,

Add to stylesheet:
..mystyle td
{
    //cell style properties
}
It applies to table cell.

But the grid header usually renders as "<tr><th ..." and not
"<tr><td ...". In this case use
..mystyle th
{

}