private void DataGrid1_ItemCreated_1(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Header)
            {    
                StringBuilder strtext=new StringBuilder();
                strtext.Append("当月</td>");
                strtext.Append("<td colspan=6></td>");
                strtext.Append("</tr>");
                strtext.Append("<tr>"); 
                strtext.Append("<td colspan=1>居民</td>");
                strtext.Append("<td colspan=2>一般</td>");
                strtext.Append("<td colspan=2>工付业</td>");
                strtext.Append("</tr>");
                strtext.Append("<tr>");
                strtext.Append("<td>" + e.Item.Cells[0].Text);                
                e.Item.Cells[0].Text =strtext.ToString();
            }
        }
這樣看下
大哥不行啊,虽然"当月"在第0个单元格,可是他没有合并6个单元格啊~
运行是这种效果:
 
					
				
			
新建的群(C#):23384106 验证注明

 
											





 
	     
										
					
	

 
										
					
	