calulations in repeater

Discussion in 'ASP .Net' started by Tom, Feb 11, 2008.

  1. Tom

    Tom Guest

    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?
    Tom, Feb 11, 2008
    #1
    1. Advertising

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


    "Tom" <> wrote in message
    news:%...
    > 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?
    >
    Eliyahu Goldin, Feb 11, 2008
    #2
    1. Advertising

  3. Tom

    sloan Guest

    See my post here:

    http://groups.google.com/group/microsoft.public.dotnet.general/msg/9738c9b0c5f2412f


    ...





    "Tom" <> wrote in message
    news:%...
    > 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?
    >
    sloan, Feb 11, 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. Replies:
    0
    Views:
    851
  2. Replies:
    0
    Views:
    2,877
  3. Replies:
    1
    Views:
    7,018
    Karl Seguin
    Aug 10, 2005
  4. uncensored
    Replies:
    0
    Views:
    811
    uncensored
    Oct 25, 2006
  5. Microsoft

    Repeater inside a Repeater

    Microsoft, Aug 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    205
    Microsoft
    Aug 21, 2006
Loading...

Share This Page