views:

73

answers:

1

I have an SqlDataSource object, linked to a GridView, which receives data from a database when executed.

I'd like to add the values of the "Cost" column, to get the "TotalCost", and place it in a TextBox or Label on top of the GridView.

Is it possible to just use (recycle) the data in the SqlDataSource object, instead of using another SqlDataSource object to just get the TotalCost"?

+1  A: 

If you handle the rowdatabound event you can get the values from each row to get your total.

Jeremy
Should note that it's the rowdatabound event on the gridview just to avoid any confusion.
TheTXI
Thank you very much!
lamcro