I have a asp DataList
that gets populated by a DataTable
.
<asp:PlaceHolder ID="ph3" runat="server">
<asp:DataList ID="dlspec" runat="server" GridLines="Vertical" OnItemDataBound="dlspec_ItemDataBound">
<FooterStyle BackColor="#CCCCCC" />
<AlternatingItemStyle CssClass="alt-grey" />
<SelectedItemStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
<ItemTemplate>
<table width="320px">
<tr>
<td class="leftcol">
<asp:Label ID="lblDimension" runat="server" Text='<%# Eval("Dimension") %>'></asp:Label>:
</td>
<td class="ProductDetailData">
<asp:Label ID="lblName" runat="server" Text='<%# Eval("Attribute") %>'></asp:Label>
</td>
</tr>
</table>
</ItemTemplate>
</asp:DataList>
</asp:placeholder>
The problem is that I only need to display the first 5 elements in the data list and I need to hide the rest of the cells and make them "expandable" on request. How can I achieve this within the DataList control? I know there are JQuery plugins that i can use against a particular "div" tag to achieve this but I dont know how i can do this within a "DataList Control".
Help needed soon on this.. Appreciate all your valuable advice.