📄 gridview.aspx
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GridView.aspx.cs" Inherits="backup_GridView" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="gvtest" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
DataKeyNames="ZhouQH" Height="0px" OnPageIndexChanging="gvtest_PageIndexChanging"
OnRowCancelingEdit="myGridView_RowCancelingEdit" OnRowEditing="GridView1_RowEditing" OnRowDataBound="rowcomand"
OnRowUpdating="myGridView_RowUpdating" OnSorting="GridView1_Sorting" OnRowDeleting="GridView1_deleting" PageSize="5"
Width="634px" CaptionAlign="Bottom" HorizontalAlign="Center" >
<Columns>
<asp:templatefield HeaderText="选择">
<FooterTemplate>
</FooterTemplate>
<ItemTemplate>
<asp:CheckBox ID="cbxCheck" runat="server" />
</ItemTemplate>
<HeaderStyle Width="15%" />
<HeaderTemplate>
<asp:CheckBox ID="cbxAll" runat="server" OnCheckedChanged="cbxAll_CheckedChanged" Text="全选" AutoPostBack="True" />
</HeaderTemplate>
</asp:templatefield>
<asp:BoundField DataField="ZhouQH" Visible="False" />
<asp:TemplateField HeaderText="周期类型" SortExpression="ZhouQLX">
<EditItemTemplate>
<asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("ZhouQLX") %>' Width="60px"></asp:TextBox>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="Label1" runat="server" Text='<%# Bind("ZhouQLX") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="ZhouQ" HeaderText="天数" SortExpression="ZhouQ" >
<ControlStyle Width="60px" />
<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
</asp:BoundField>
<asp:BoundField DataField="SheZSJ" HeaderText="设置时间" NullDisplayText="未设置" >
<ControlStyle Width="80px" />
</asp:BoundField>
<asp:BoundField DataField="SheZYY" HeaderText="设置原因" >
<ControlStyle Width="80px" />
</asp:BoundField>
<asp:CommandField HeaderText="修改" ShowEditButton="True" />
<asp:CommandField HeaderText="删除" InsertVisible="False" ShowCancelButton="False"
ShowDeleteButton="True" />
</Columns>
<EmptyDataTemplate>
未设定
</EmptyDataTemplate>
<RowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<SelectedRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<EditRowStyle HorizontalAlign="Center" VerticalAlign="Middle" />
<FooterStyle HorizontalAlign="Left" VerticalAlign="Middle" />
<PagerStyle HorizontalAlign="Right" VerticalAlign="Middle" />
</asp:GridView>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -