Link to home
Start Free TrialLog in
Avatar of gogetsome
gogetsomeFlag for United States of America

asked on

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

ASKER CERTIFIED SOLUTION
Avatar of Ess Kay
Ess Kay
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial