利用此事件对网格控件的外观进行控件(合并列)

来源:互联网 发布:央视网络消费陷阱揭秘 编辑:程序博客网 时间:2024/05/22 10:36
//
private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
ListItemType itemType = e.Item.ItemType;
if (itemType == ListItemType.Footer)
{
// e.Item.BackColor = Color.SeaGreen;
// e.Item.Font.Bold = true;
e.Item.Cells.RemoveAt(0);
e.Item.Cells.RemoveAt(0);
e.Item.Cells[0].ColumnSpan = 3;
e.Item.Cells[0].HorizontalAlign = HorizontalAlign.Right;

}