Improve company productivity with a Business Account.Sign Up

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 207
  • Last Modified:

datalist EmptyItemStyle

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

1 Solution
Ess KayEntrapenuerCommented:
in your query, just suppress null values (where column is not null )
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now