2.0: Gridview row styles applied to TR, does not work

  • Thread starter HoustonFreeways
  • Start date
H

HoustonFreeways

Here I use the style attributes for a Gridview, such as
AlternatingRowStyle-BorderColor

<asp:GridView runat=server ID=gv_tabular_data AllowPaging=false
AllowSorting=false
BorderColor=#F17901
BorderStyle=Solid
BorderWidth=2px
AlternatingRowStyle-BackColor=#FFFEC5
AlternatingRowStyle-BorderColor=#F17901
AlternatingRowStyle-BorderWidth=1px
HeaderStyle-BorderWidth=2px
ShowHeader=true ShowFooter=false >
<RowStyle BackColor=#FFF1C5
BorderColor=#F17901
BorderStyle=double
BorderWidth=1px />

</asp:GridView>

When this is rendered in HTML, notice that all the row styles are added to
the TR tag, but only background-color is valid for TR tags. The other styles
(border-color, border-width, border-style) are not valid for TR elements so
obviously they do nothing.

<tr
style="background-color:#FFF1C5;border-color:#F17901;border-width:1px;border-style:Double;">
<td>2/1/2006 6:52:52 AM</td><td>2/1/2006
6.881</td><td>0</td><td>-0.03</td><td>-70.01</td>
</tr>

Am I missing something here? Why would the invalid styles be applied to the
TR tag?
 
R

Randall

I just ran across this problem. One thing to check here is any styles
that you might have created for the TD elements. I have verified if I
remove my TD style, then the RowStyle will be applied.
Have you found a solution to this problem without removing your TD
style?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top