Displaying a counter value within a Repeater Control

  • Thread starter Thread starter Bhelliom
  • Start date Start date
B

Bhelliom

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?
 
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
 
Back
Top