Assuming your datagrid is bound to a dataset, you can do this:
if(e.Item.ItemType == ListItemType.Footer)
{
//sum every column
for(int i = 0; i < e.Items.Count - 1; i++)
e.Item.Cells[i].Text = ds.Tables[0].Compute("Sum([" +
e.Item.Cells[i].HeaderText + "])",String.Empty);
roughly
--
Regards,
Alvin Bruney
[ASP.NET MVP
http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here...
http://tinyurl.com/27cok
"William Gower" <> wrote in message
news:...
>I would like to sum a column in my dataset and have it displayed at the
> bottom of the datagrid in the footer. How do I do that?
>
>