calulations in repeater

T

Tom

I'm using the Repeater Control for my output, within the repeater I need to
show totals for some of the rows. Is there a way to do calculations within
the repeater like you can within the grid?

For example:
I need to do a calculation that wil show me total income. This number is the
total of the out put of row 1 + row 2 + row 3 within my repeater.

so if my repeater has output like this


total income 9000
sales - NE 4500
sales - SE 4500

Is there a way to take the sales NE row + sales SE row and do the calc?
 
E

Eliyahu Goldin

There is no much difference between the repeater and the gridview for this
matter. Loop through the item in the PreRender event or catch them on fly in
the ItemDataBound event, use FindControl calls to get to the controls
holding the values and do your calculations.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
 

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