T
tshad
I am building a GridView that is displaying some money values in 3 columns.
I want to put the totals of each column in a label field (one for each
column) in the footer.
I was trying to figure out which was the faster way or more efficient way.
I originally thought about getting SQL to do it, but that would entail
either a second Select or some type of subquery or self join, which I am not
sure is the best way.
The other way was to just total the columns in the grid as I bind the grid
(or after in the PreRender event).
I usually like to do my cleaning up of the grid or assign colors to the text
in the grid (based on the data) in the PreRender event. I just loop through
the grid and do the changes at that point.
I could also do the changes during the ItemDataBind event but am not sure
which would be better - add them up in the ItemDataBind event with the
overhead of the event firing for each row or just do it all at once in the
PreRender event.
Even in the PreRender event - how would I get access to the label in the
Footer of the GridView to sum up the rows?
Thanks,
Tom
I want to put the totals of each column in a label field (one for each
column) in the footer.
I was trying to figure out which was the faster way or more efficient way.
I originally thought about getting SQL to do it, but that would entail
either a second Select or some type of subquery or self join, which I am not
sure is the best way.
The other way was to just total the columns in the grid as I bind the grid
(or after in the PreRender event).
I usually like to do my cleaning up of the grid or assign colors to the text
in the grid (based on the data) in the PreRender event. I just loop through
the grid and do the changes at that point.
I could also do the changes during the ItemDataBind event but am not sure
which would be better - add them up in the ItemDataBind event with the
overhead of the event firing for each row or just do it all at once in the
PreRender event.
Even in the PreRender event - how would I get access to the label in the
Footer of the GridView to sum up the rows?
Thanks,
Tom