<%@ Page language="c#" Codebehind="DataGridMultiUse.aspx.cs" AutoEventWireup="false" Inherits="CommonFunction.DataGridMulUse" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>DataGridMulUse</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 bgColor="#66cc99" MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<h2>DataGrid控件综合举例:</h2>
			<TABLE id="Table1" style="WIDTH: 672px; HEIGHT: 265px" cellSpacing="1" cellPadding="1"
				width="672" border="0">
				<TR>
					<TD align="center"><asp:validationsummary id="ValidationSummary1" runat="server" Height="40px" Width="496px"></asp:validationsummary></TD>
				</TR>
				<TR>
					<TD><asp:datagrid id="dgEditInfo" runat="server" Height="20px" Width="672px" AutoGenerateColumns="False"
							PageSize="5" AllowPaging="True">
							<Columns>
								<asp:TemplateColumn HeaderText="LastName">
									<ItemTemplate>
										<asp:TextBox id=LastName runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.LastName") %>'>
										</asp:TextBox>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="ReportsTo">
									<ItemTemplate>
										<asp:TextBox id=Reports runat="server" Width="70px" Text='<%# DataBinder.Eval(Container, "DataItem.ReportsTo") %>'>
										</asp:TextBox>
										<asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" ControlToValidate="Reports" ErrorMessage="请输入数字"
											ValidationExpression="\d">!</asp:RegularExpressionValidator>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="FirstName">
									<ItemTemplate>
										<asp:TextBox id=FirstName runat="server" Width="164px" Text='<%# DataBinder.Eval(Container, "DataItem.FirstName") %>'>
										</asp:TextBox>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="City">
									<ItemTemplate>
										<asp:TextBox id=City runat="server" Width="156px" Text='<%# DataBinder.Eval(Container, "DataItem.City") %>'>
										</asp:TextBox>
									</ItemTemplate>
									<FooterStyle HorizontalAlign="Right"></FooterStyle>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="删除">
									<ItemTemplate>
										<asp:LinkButton id="DeleteRow" runat="server" CommandName="Delete">删除</asp:LinkButton>
									</ItemTemplate>
								</asp:TemplateColumn>
							</Columns>
							<PagerStyle NextPageText="Next" PrevPageText="Previous" HorizontalAlign="Center" Mode="NumericPages"></PagerStyle>
						</asp:datagrid></TD>
				</TR>
				<TR>
					<TD align="right"><asp:linkbutton id="AddRow" runat="server">增加</asp:linkbutton><asp:textbox id="RowCount" runat="server" Width="30px">1</asp:textbox>行</TD>
				</TR>
				<TR>
					<TD><FONT face="宋体"><asp:button id="btnSave" runat="server" Width="48px" Text="保存"></asp:button></FONT></TD>
				</TR>
				<TR>
					<TD><FONT face="宋体"><asp:datagrid id="dgSaveInfo" runat="server"></asp:datagrid></FONT></TD>
				</TR>
			</TABLE>
		</form>
	</body>
</HTML>
