Groups | Blog | Home
all groups > asp.net datagrid control > october 2006 >

asp.net datagrid control : Can't seem to bind data in a header or footer of a datalist.


UJ
10/3/2006 8:53:20 AM
I'm trying to bind data in a header list and it doesn't appear to work. My
code is:


<asp:DataList id="dgOurSolutionArray" runat="server"
RepeatDirection="Horizontal" RepeatColumns="4">
<HeaderTemplate>Fred
<%# DataBinder.Eval(Container.DataItem, "ShortDescription") %>
</HeaderTemplate>
<FooterTemplate>
<%# DataBinder.Eval(Container.DataItem, "SolutionID") %>
</FooterTemplate>
<ItemTemplate>
<%# DataBinder.Eval(Container.DataItem, "ShortDescription") %>
</ItemTemplate>
</asp:DataList>


I get my short description once, and Fred at the top. No matter what I put
in for the header/footer for DataElements, it doesn't seem to show up.

Any ideas?

TIA - Jeff.


Ken Cox [Microsoft MVP]
10/3/2006 11:14:38 AM
The HeaderTemplate and FooterTemplate aren't designed for repeating data the
way ItemTemplate is.

What is it that you're trying to accomplish?

Ken
Microsoft MVP [ASP.NET]

[quoted text, click to view]

AddThis Social Bookmark Button