datalist EmptyItemStyle

Posted on 2013-01-21
Last Modified: 2013-02-05
Hello, I have a datalist as coded below. I know there is no emptyitemstyle for the datalist.

The datalist has the repoearcolumns set to 2. If there are three items returned from the database then I get a border around the forth... null item.

How can I remove the border around the null item?

<asp:DataList ID="gvViewImages" runat="server" Font-Names="Verdana" Font-Size="Small"
                                                    RepeatColumns="2" Width="100%" AlternatingItemStyle-BorderStyle="None" ItemStyle-BorderStyle="None"
                                                    BorderStyle="None" GridLines="None" EditItemStyle-BorderStyle="None"
                                                    SelectedItemStyle-BorderStyle="None" SeparatorStyle-BorderStyle="None">
                                                        <div style="page-break-inside: avoid; text-align: center">
                                                            <asp:Image runat="server" ID="imgViewSurveyImage" ImageUrl='<%#"~/survey-images/" & Eval("Photo")%>' />
                                                            <asp:Label runat="server" ID="lblViewImageId" Text='<%# Eval("Id")%>' Visible="false"></asp:Label>
                                                            <asp:Label runat="server" ID="lblViewImageSurveyDetailId" Text='<%# Eval("SurveyDetailId")%>' Visible="false"></asp:Label>

Open in new window

Question by:gogetsome
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
1 Comment
LVL 15

Accepted Solution

Ess Kay earned 500 total points
ID: 38806846
in your query, just suppress null values (where column is not null )

Featured Post

Raise the IQ of Your IT Alerts

From IT major incidents to manufacturing line slowdowns, every business process generates insights that need to reach the people required to take action. You need a platform that integrates with your business tools to create fully enabled DevOps toolchains.

You need xMatters.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization ( and XML Serialization ( In this article we will try to know more about SOAP (Simple Object Acces…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

696 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