Displaying number of data items in a Repeater using the DataBinder

  • Thread starter Tomasz Zaniewski
  • Start date
T

Tomasz Zaniewski

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

Eliyahu Goldin

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

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,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top