calulations in repeater

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tom

    calulations in repeater

    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

    #2
    Re: calulations in repeater

    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]




    "Tom" <Tom@yahoo.comw rote in message
    news:%23TBhmjLb IHA.4208@TK2MSF TNGP04.phx.gbl. ..
    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?
    >

    Comment

    • sloan

      #3
      Re: calulations in repeater

      See my post here:




      ...





      "Tom" <Tom@yahoo.comw rote in message
      news:%23TBhmjLb IHA.4208@TK2MSF TNGP04.phx.gbl. ..
      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?
      >

      Comment

      Working...