Displaying a counter value within a Repeater Control

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?
 
E

Eliyahu Goldin

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top