private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if ( e.Item.ItemType == ListItemType.Header )
{
TableCellCollection tcl = e.Item.Cells;
tcl.Clear();
tcl.Add( new TableHeaderCell() );
tcl[0].RowSpan = 2;
tcl[0].Text = "資料項目";
tcl.Add( new TableHeaderCell() );
tcl[1].ColumnSpan = 2;
tcl[1].Text = "會計科目</th></tr><tr><th>借</th><th>貸";
}
}
{
if ( e.Item.ItemType == ListItemType.Header )
{
TableCellCollection tcl = e.Item.Cells;
tcl.Clear();
tcl.Add( new TableHeaderCell() );
tcl[0].RowSpan = 2;
tcl[0].Text = "資料項目";
tcl.Add( new TableHeaderCell() );
tcl[1].ColumnSpan = 2;
tcl[1].Text = "會計科目</th></tr><tr><th>借</th><th>貸";
}
}