remove some cells and set ColumnSpan property: <asp:DataGrid id="DataGrid1" runat="server" BackColor="#C0C000" ShowFooter="true" OnItemDataBound="DataGrid1_ItemBound"></asp:DataGrid>
... void DataGrid1_ItemBound(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Footer)
{
int nCount = e.Item.Cells.Count;
for (int i=0; i < nCount-1; i++)
e.Item.Cells.RemoveAt(0); e.Item.Cells[0].ColumnSpan = nCount;
} }
... void DataGrid1_ItemBound(object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Footer)
{
int nCount = e.Item.Cells.Count;
for (int i=0; i < nCount-1; i++)
e.Item.Cells.RemoveAt(0); e.Item.Cells[0].ColumnSpan = nCount;
} }
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货