數(shù)據(jù)項(xiàng) |
帳目開支 |
|
支出 |
入帳 |
|
在 DataGrid 對(duì)象的 ItemCreate 事件中加入以下程序代碼:
西部e網(wǎng)(www.wsalc.com)
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 = "數(shù)據(jù)項(xiàng)";
tcl.Add( new TableHeaderCell() );
tcl[1].ColumnSpan = 2;
tcl[1].Text = "帳目開支</th></tr><tr><th>支出</th><th>入帳";
}
}