Can't seem to bind data in a header or footer of a datalist.

Discussion in 'ASP .Net Datagrid Control' started by UJ, Oct 3, 2006.

  1. UJ

    UJ Guest

    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.
    UJ, Oct 3, 2006
    #1
    1. Advertising

  2. 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]

    "UJ" <> wrote in message
    news:...
    > 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], Oct 3, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nevyn Twyll
    Replies:
    8
    Views:
    1,866
  2. mr2_93
    Replies:
    1
    Views:
    3,593
    mr2_93
    Oct 2, 2005
  3. =?Utf-8?B?QVNQIERldmVsb3Blcg==?=

    How do you bind a datalist that is inside a bound datalist

    =?Utf-8?B?QVNQIERldmVsb3Blcg==?=, Sep 25, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    573
    =?Utf-8?B?QVNQIERldmVsb3Blcg==?=
    Sep 26, 2006
  4. snellog

    Passing Values from Header to footer of an DataList

    snellog, Nov 24, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    316
    snellog
    Dec 3, 2003
  5. Henrik
    Replies:
    1
    Views:
    423
    Ken Cox [Microsoft MVP]
    Jul 6, 2006
Loading...

Share This Page