Repeater/DataBinder Question

Discussion in 'ASP .Net' started by George Durzi, Nov 9, 2004.

  1. George Durzi

    George Durzi Guest

    Here's my asp:Repeater

    <asp:Repeater ID="rptHelpDeskSystemStatus" Runat="server">
    <HeaderTemplate>
    <table width="100%" border="0" class="datatable">
    <tr class="item">
    </HeaderTemplate>
    <ItemTemplate>
    <td align="center">
    <asp:Label ID="lblService" Runat="server" Text='<%#
    DataBinder.Eval(Container, "DataItem.Service").ToString()%>'/>
    <br/>
    <asp:Image ID="imgStatus" Runat="server"
    ImageUrl='<%#string.Concat("../img/SystemStatus_",
    DataBinder.Eval(Container, "DataItem.Status").ToString(), ".gif")%>'/>
    </td>
    </ItemTemplate>
    <FooterTemplate>
    </tr>
    </table>
    </FooterTemplate>
    </asp:Repeater>

    I'd like to add a header row in my HeaderTemplate, the problem is, I have to
    set a ColSpan on it based on the number of rows in my DataSet (the
    DataSource of my Repeater)

    So I'd like my HeaderTemplate to look like this:
    <HeaderTemplate>
    <table width="100%" border="0" class="datatable">
    <tr class="header">
    <td colspan='<%# %>'>
    </tr>
    <tr class="item">
    </HeaderTemplate>


    <td colspan='<%# %>'> .... How can I get the number of rows in my datasource
    into here...

    I looked up DataBinder.GetPropertyValue ... but I can't find an enumeration
    of the property names.


    Thank You!
    George Durzi, Nov 9, 2004
    #1
    1. Advertising

  2. George Durzi

    Darrel Guest

    > I'd like to add a header row in my HeaderTemplate, the problem is, I have
    > to set a ColSpan on it based on the number of rows in my DataSet (the
    > DataSource of my Repeater)


    Not a direct answer, but instead of using a TD with a 'header' class, you
    could consider using a caption tag and style it via CSS:

    http://www.w3schools.com/tags/tag_caption.asp

    -Darrel
    Darrel, Nov 9, 2004
    #2
    1. Advertising

  3. George Durzi

    George Durzi Guest

    Thank you!!
    Why have I never heard of this "caption" tag!!?? hahah

    "Darrel" <> wrote in message
    news:%...
    >> I'd like to add a header row in my HeaderTemplate, the problem is, I have
    >> to set a ColSpan on it based on the number of rows in my DataSet (the
    >> DataSource of my Repeater)

    >
    > Not a direct answer, but instead of using a TD with a 'header' class, you
    > could consider using a caption tag and style it via CSS:
    >
    > http://www.w3schools.com/tags/tag_caption.asp
    >
    > -Darrel
    >
    George Durzi, Nov 9, 2004
    #3
    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. dm_dal

    DataBinder.Eval question

    dm_dal, Feb 16, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    435
    dm_dal
    Feb 16, 2004
  2. Chris

    DataBinder.Eval question

    Chris, Apr 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,394
    =?Utf-8?B?QmluIFNvbmcsIE1DUA==?=
    Apr 21, 2004
  3. Chris
    Replies:
    1
    Views:
    955
    =?Utf-8?B?QmluIFNvbmcsIE1DUA==?=
    May 28, 2004
  4. =?Utf-8?B?UGllcnJlIFNoaXJ2YW4=?=

    Question about DataBinder.Eval method

    =?Utf-8?B?UGllcnJlIFNoaXJ2YW4=?=, Jan 28, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    4,079
    =?Utf-8?B?UGllcnJlIFNoaXJ2YW4=?=
    Jan 31, 2005
  5. Tomasz Zaniewski

    Displaying number of data items in a Repeater using the DataBinder

    Tomasz Zaniewski, Dec 6, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    144
    Eliyahu Goldin
    Dec 6, 2004
Loading...

Share This Page