Displaying a counter value within a Repeater Control

Discussion in 'ASP .Net' started by Bhelliom, May 17, 2005.

  1. Bhelliom

    Bhelliom Guest

    Hi there,

    something I thought would be really really easy so far hasn't been easy
    at all.

    I'm using the Repeater control to produce some HTML with values taken
    from a DataSet. That is totally fine, works without a hitch.

    What I would love to do is have the iteration count of the Repeater as
    it outputs the HTML - ie:

    1. row 1
    2. row 2
    3. row 3 etc etc

    I cannot for the life of me find a way to get the Repeater to provide
    me with the increasing count value (I've been able to get a final
    count, which isn't that useful).

    Has anyone got an suggestions?
    Bhelliom, May 17, 2005
    #1
    1. Advertising

  2. Put a label in the item template. In the PreRender event loop through the
    data items and assign the iteration index value to the label's Text.

    Eliyahu

    "Bhelliom" <> wrote in message
    news:...
    > Hi there,
    >
    > something I thought would be really really easy so far hasn't been easy
    > at all.
    >
    > I'm using the Repeater control to produce some HTML with values taken
    > from a DataSet. That is totally fine, works without a hitch.
    >
    > What I would love to do is have the iteration count of the Repeater as
    > it outputs the HTML - ie:
    >
    > 1. row 1
    > 2. row 2
    > 3. row 3 etc etc
    >
    > I cannot for the life of me find a way to get the Repeater to provide
    > me with the increasing count value (I've been able to get a final
    > count, which isn't that useful).
    >
    > Has anyone got an suggestions?
    >
    Eliyahu Goldin, May 17, 2005
    #2
    1. Advertising

  3. Bhelliom

    xizwyck

    Joined:
    May 26, 2008
    Messages:
    2
    Doesn't work. Solution not tested by poster.
    xizwyck, May 26, 2008
    #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. Darren Smith
    Replies:
    5
    Views:
    5,509
    dsmith
    May 10, 2004
  2. The Eeediot
    Replies:
    3
    Views:
    2,217
    =?Utf-8?B?UnVsaW4gSG9uZw==?=
    Dec 22, 2004
  3. Eric Layman

    add row counter in a repeater control

    Eric Layman, Apr 4, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    674
    =?Utf-8?B?TWlsb3N6IFNrYWxlY2tpIFtNQ0FEXQ==?=
    Apr 4, 2007
  4. George2
    Replies:
    1
    Views:
    784
    Alf P. Steinbach
    Jan 31, 2008
  5. Brian Miller
    Replies:
    6
    Views:
    672
    Brian Miller
    Nov 18, 2004
Loading...

Share This Page