日期:2012-09-26 浏览次数:20865 次
创建一个全局变量
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);
Label L_SumData=new Label();
L_SumData.ID="L_SumData";
L_SumData.Width=30;
L_SumData.Text=SumData();
tc2.Controls.Add(L_SumData);
Label L_zj=new Label();
L_zj.ID="lb_zj";
L_zj.Width=30;
L_zj.Text="总合计";
tc1.Controls.Add(L_zj);
Label L_SumPage = new Label();
L_SumPage.ID=”l_sumPage”;