DataGrid脚眉显示合计
创建一个全局变量
Public double Sumdb;
private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
ListItemType lit=e.Item.ItemType;
if(lit==ListItemType.Footer)
{
TableCell tc1=e.Item.Cells[3];
TableCell tc2=e.Item.Cells[4];
TableCell tc3=e.Item.Cells[5];
TableCell tc4=e.Item.Cells[6];
Label L_xj=new Label();
L_xj.ID="lb_xj";
L_xj.Width=30;
L_xj.Text="合计";
tc1.Controls.Add(L_xj);