Re: Format DataList



I tried setting the background color of the table to transparent like
this:

<asp:DataList ID="dlYourCart" AlternatingItemStyle-BackColor="lavender"
ItemStyle-BackColor="pink" runat="server">
<HeaderTemplate>
<table bordercolor="black" cellspacing="0" class="format" width="100%"
style="background-image: none; background-color: transparent;">

but that doesn't make any difference - the background-color of the
entire table still remains white.

Any other ideas?

Never thought that formatting a DataList would be such a pain in the
wrong place!


Phil H wrote:
I've come across this behaviour too when using HTML table objects in a
DataList template. It is the default back colour of the table that is
rendered rather than that of the template.

I presume the table is there to control positioning within the
template. On the occasion when I did this I ended up abandoning this
method in favour of setting the width and height of the databound
labels to effect positioning because with the table they wouldn't line
properly with the the header.

If you need to use a table and don't want the back color to dominate,
try setting the back color of the table to transparent.

Good luck

.



Relevant Pages

  • Re: Color Bug?
    ... If you set the background color of a component, be sure the color has no ... public void adjustColor(int r, int g, int b, int a) { ... a transparent color rendering effect. ...
    (comp.lang.java.programmer)
  • Re: Bitmap to Icon
    ... What I'm doing is reading an .ico file then converting it to a bitmap which I ... I make the background color transparent then convert it back to ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Windows forms with Transparent Backgrounds
    ... When I do this I end up seeing the background color for the form, and you can't set the Background Color of a form to transparent if you do you get a nice runtime error. ... Set the Region property of the form to a new Region, passing in the constructor the GraphicsPath object that you have just created. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Shape background
    ... This is nowhere near as easy as it seems because computers are very bad at ... is completely transparent fill the same as background ... should we compare slide background color and shape background color? ...
    (microsoft.public.powerpoint)
  • Re: how to add css to acordion HeaderTemplate
    ... 'collapsePanelHeader' has a background color and it works quite well ... David Wier ... change the background color of its HeaderTemplate and can't figure out ...
    (microsoft.public.dotnet.framework.aspnet)