在RowDataBound
DataGrid合并
e.Item.Cells[0].ColumnSpan = e.Item.Cells.Count;
while(e.Item.Cells.Count>1)
{
e.Item.Cells.RemoveAt(1);
}
GridView合并
e.Row.Cells[0].ColumnSpan = e.Row.Cells.Count;
while (e.Row.Cells.Count > 1)
{
   e.Row.Cells.RemoveAt(1);
}
---------------------------------------
以上两种在程序运行的时候绑定到DataGrid或GridView时可以正确合并
但当外界有向服务器提交的时候.
合并的页脚就会出错,本来合并的页脚又会多出来把表格拉长请问怎么办