Solved

datalist EmptyItemStyle

Posted on 2013-01-21
1
192 Views
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">
                                                    <ItemTemplate>
                                                        <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>
                                                        </div>
                                                    </ItemTemplate>
                                                </asp:DataList>

Open in new window

0
Comment
Question by:gogetsome
1 Comment
 
LVL 15

Accepted Solution

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

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
EF5: Question about Metadata Artifact Processing 4 17
SQL Help 27 46
VB.Net Tranfer data between to VB.Net apps 8 27
No Data for DropDown List 2 26
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

832 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