I'm using a ListView (ASP.net Web Forms) to display some data, I'm also using the 'GroupItemCount' control to group each entry on the page in groups of two, essentially creating a two column row.
I would like to place the first entry of the ListView inside one div and the second in seperate div, obviously repeating this sequence for each entry (Entry 3 in Div1, Entry 4 in Div2, etc). I'm unsure how I can achieve this however, my knowledge working in asp.net is pretty limited.
Here's the mark-up, cheers:
<asp:ListView ID="productList" runat="server" DataKeyNames="ProductID" GroupItemCount="2" ItemType="WLL.Models.Product" SelectMethod="GetProducts"> <EmptyDataTemplate> <table > <tr> <td>No data was returned.</td> </tr> </table> </EmptyDataTemplate> <EmptyItemTemplate> <td/> </EmptyItemTemplate> <GroupTemplate> <tr id="itemPlaceholderContainer" runat="server"> <td id="itemPlaceholder" runat="server"></td> </tr> </GroupTemplate> <ItemTemplate> <td runat="server"> <table> <tr> <td> <a href="ProductDetails.aspx?productID=<%#:Item.ProductID%>"> <img src="/Catalog/Images/Thumbs/<%#:Item.ImagePath%>" width="100" height="75" style="border: solid" /></a> </td> </tr> <tr> <td> <a href="ProductDetails.aspx?productID=<%#:Item.ProductID%>"> <span> <%#:Item.ProductName%> </span> </a> <br /> <span> <b>Price: </b><%#:String.Format("{0:c}", Item.UnitPrice)%> </span> <br /> </td> </tr> <tr> <td> </td> </tr> </table> </p> </td> </ItemTemplate> <LayoutTemplate> <table style="width:100%;"> <tbody> <tr> <td> <table id="groupPlaceholderContainer" runat="server" style="width:100%"> <tr id="groupPlaceholder"></tr> </table> </td> </tr> <tr> <td></td> </tr> <tr></tr> </tbody> </table> </LayoutTemplate> </asp:ListView> </div> </section>
Aucun commentaire:
Enregistrer un commentaire