Solved

Datalist question

Posted on 2006-12-01
7
367 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ClickOnce Install - Shortcut Question 3 72
triangle challenge 4 121
allStar challenge 1 52
index Out OF Range Exception error 4 54
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…
A short article about problems I had with the new location API and permissions in Marshmallow
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

896 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now