Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Datalist question

Posted on 2006-12-01
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">
            <table class="bordered" cellpadding="2" cellspacing="0" width="100%">
            <tr class="header_row">
                <th colspan="3" class="h_12">Blackberry</th>
            <tr class="subheader_row">
                <th class="b_9" width="250">Device Count</th>
                <th class="b_9" colspan="2">Hierarchy</th>
            <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>
                  <asp:Label ID="lblBBTotal" CssClass="b_10" runat="server" />
              <td colspan="2" align="right">
                <a class="reglink" href="HierarchyReport.aspx?vendor=<%=lblVendor.text%>&action=HierarchyReportBB" target="_blank">Download Excel Report</a>

For whatever reason, it's putting an extra <td> tag around the <itemtemplate>, like such:
            --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>

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


Question by:stretch73

Expert Comment

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

Author Comment

ID: 18056074
It's making the border double as thick as it is supposed to be

Expert Comment

ID: 18056715
Is the cellpadding="2" causing it?
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.


Author Comment

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.

Author Comment

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.

Accepted Solution

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

Best regards,
Experts Exchange
Community Support Moderator

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Currency Conversion? 1 98
Math Equation 23 105
Recover unsaved Tab contents (and settings/preferences) from Notepad++ 3 92
Eclipse Java import and method not resolved 4 48
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …

840 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