Solved

Datalist question

Posted on 2006-12-01
7
378 Views
Last Modified: 2010-04-16
I am working with the following datalist and it's giving me a problem.  


    <asp:Datalist ID="dlBB" align="center" Width="95%" OnItemCreated="DataList_ItemCreated" runat="server">
        <HeaderTemplate>
            <table class="bordered" cellpadding="2" cellspacing="0" width="100%">
            <tr class="header_row">
                <th colspan="3" class="h_12">Blackberry</th>
            </tr>
            <tr class="subheader_row">
                <th class="b_9" width="250">Device Count</th>
                <th class="b_9" colspan="2">Hierarchy</th>
            </tr>
        </HeaderTemplate>
       
        <ItemTemplate>
            <tr onmouseover="style.backgroundColor='#FFFFCC'" onmouseout="style.backgroundColor=''">
                <td class="r_10" width="100"><%# Container.Dataitem("DeviceCount")%>&nbsp;</td>
                <td class="r_10" colspan="2"><%#CommonFunctions.CommonFunctions.GetHierarchy(Container.DataItem("Hierarchy"))%>&nbsp;</td>
            </tr>
        </ItemTemplate>
       
       <FooterTemplate>
            <tr>
              <td>
                  <asp:Label ID="lblBBTotal" CssClass="b_10" runat="server" />
              </td>
              <td colspan="2" align="right">
                <a class="reglink" href="HierarchyReport.aspx?vendor=<%=lblVendor.text%>&action=HierarchyReportBB" target="_blank">Download Excel Report</a>
              </td>
            </tr>
            </table>
        </FooterTemplate>
    </asp:Datalist>


For whatever reason, it's putting an extra <td> tag around the <itemtemplate>, like such:
<tr><td>
            --contents of the item template
                <td class="r_10" width="100">1&nbsp;</td>
                <td class="r_10" colspan="2">F - TS & F&nbsp;</td>
 </td></tr>

It's screwing up my css and driving me nuts.  Any thoughts?

Thanks,

N
0
Comment
Question by:stretch73
7 Comments
 
LVL 4

Expert Comment

by:hclgroup
ID: 18056034
In what way is it messing with your CSS?
0
 

Author Comment

by:stretch73
ID: 18056074
It's making the border double as thick as it is supposed to be
0
 
LVL 2

Expert Comment

by:AmNoGeek
ID: 18056715
Is the cellpadding="2" causing it?
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:stretch73
ID: 18096604
Changing the cellpadding didn't change anything.  I think it's something to do with the way the Datalist generates HTML.  I changed one of the datalists to a repeater control and it worked fine.
0
 

Author Comment

by:stretch73
ID: 18103292
In the interest of time, I just changed all of the datalists to repeater controls which seems to have fixed the problem.  Apparently it renders HTML differently which is why I was getting extra tags.
0
 

Accepted Solution

by:
RomMod earned 0 total points
ID: 18135868
Question closed - 250 points refunded.

Best regards,
RomMod
Experts Exchange
Community Support Moderator
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question