Displaying number of data items in a Repeater using the DataBinder

Discussion in 'ASP .Net Datagrid Control' started by Tomasz Zaniewski, Dec 6, 2004.

  1. Hi,

    Does anyone know of a method to read the number of items in a repeater and
    display it in each item in the repeater.

    I want to display something in the lines of:
    Item x of y for each item in the repeater and am not sure how to get this. I
    can get the x, but not the y.
    Currently I am using:
    <%# DataBinder.Eval(Container.DataItem, "Count")%> of <%#
    DataBinder.Eval(???,???)%>

    I am not sure what to put instead of the '???'. Is there some other way to
    do this?

    Thanks.
     
    Tomasz Zaniewski, Dec 6, 2004
    #1
    1. Advertising

  2. In codebehind make a property that will return the number of items in the
    data source and databind to that property.

    Eliyahu

    "Tomasz Zaniewski" <> wrote in
    message news:...
    > Hi,
    >
    > Does anyone know of a method to read the number of items in a repeater

    and
    > display it in each item in the repeater.
    >
    > I want to display something in the lines of:
    > Item x of y for each item in the repeater and am not sure how to get this.

    I
    > can get the x, but not the y.
    > Currently I am using:
    > <%# DataBinder.Eval(Container.DataItem, "Count")%> of <%#
    > DataBinder.Eval(???,???)%>
    >
    > I am not sure what to put instead of the '???'. Is there some other way to
    > do this?
    >
    > Thanks.
    >
     
    Eliyahu Goldin, Dec 6, 2004
    #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. MS
    Replies:
    0
    Views:
    3,219
  2. George Durzi

    Repeater/DataBinder Question

    George Durzi, Nov 9, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    493
    George Durzi
    Nov 9, 2004
  3. Antoine
    Replies:
    2
    Views:
    612
    Antoine
    Nov 29, 2004
  4. Ben
    Replies:
    2
    Views:
    897
  5. Dave Hansen

    Displaying group data set in repeater or datagrid

    Dave Hansen, Sep 18, 2003, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    728
    Jacob Yang [MSFT]
    Sep 19, 2003
Loading...

Share This Page