例子比较简单,直接贴代码了,例子达到以下功能:
(1)两个DataGrid嵌套
(2)外面一个DataGrid分页
(3)里面一个DataGrid动态增加模板列
<%
@ Page language="c#" Codebehind="WebForm45.aspx.cs" AutoEventWireup="false" Inherits="csdn2.WebForm45" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>Test</title>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="C#" name="CODE_LANGUAGE">
<meta content="JavaScript" name="vs_defaultClientScript">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<asp:datagrid id="DataGrid1" runat="server" AutoG