您的位置:首页 > 编程语言 > ASP

ASP.NET 2.0中合并 GridView 的表头单元格

2009-03-24 12:24 537 查看
在实际工作中,往往需要合并表格头部的单元格,下面就是一个实现的例子。运行结果如图:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>合并 GridView 的表头单元格</title>
</head>
<body>
<form id="Form1" runat="server">
<asp:GridView ID="GridView1" runat="server" CellSpacing="1" CellPadding="3"
Font-Size="12px" Width="300px" BackColor="orange" BorderWidth="0"
OnRowDataBound="GridView1_RowDataBound" OnRowCreated="GridView1_RowCreated">
</asp:GridView>
</form>
</body>
</html>

VB.NET

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>合并 GridView 的表头单元格</title>
</head>
<body>
<form id="Form1" runat="server">
<asp:GridView ID="GridView1" runat="server" CellSpacing="1" CellPadding="3"
Font-Size="12px" Width="300px" BackColor="orange" BorderWidth="0"
OnRowDataBound="GridView1_RowDataBound" OnRowCreated="GridView1_RowCreated">
</asp:GridView>
</form>
</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: