Quantcast
Channel: Active questions tagged listview - Stack Overflow
Viewing all articles
Browse latest Browse all 790

How to use asp:Table in asp:ListView LayoutTemplate ItemTemplate

$
0
0

I get the following exception message when I call the DataBind() method of the ListView

'Table' cannot have children of type 'ListViewDataItem'.

Here's my markup

<asp:ListView ID="lv" runat="server"><LayoutTemplate><asp:Table ID="t" runat="server" CssClass="contentframework"><asp:TableHeaderRow><asp:TableHeaderCell>1</asp:TableHeaderCell><asp:TableHeaderCell>2</asp:TableHeaderCell></asp:TableHeaderRow><asp:TableRow ID="itemPlaceHolder" runat="server" /></asp:Table></LayoutTemplate><ItemTemplate><asp:TableRow><asp:TableCell><%# Eval("1") %></asp:TableCell><asp:TableCell><%# Eval("2") %></asp:TableCell></asp:TableRow></ItemTemplate><EmptyDataTemplate><h2>No Records!</h2></EmptyDataTemplate></asp:ListView>

Viewing all articles
Browse latest Browse all 790

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>