Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 205
  • 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">
                                                    <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
gogetsome
Asked:
gogetsome
1 Solution
 
Ess KayEntrapenuerCommented:
in your query, just suppress null values (where column is not null )
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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