您的位置:首页 > 其它

关于GridView中自定义分页、单选、多选的简单应用

2007-01-10 11:30 423 查看
关于GridView中自定义分页、单选、多选的简单应用 [转贴 2006-06-05 09:46:58 | 发表者: 笨笨zlj] 0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top><html xmlns="http://www.w3.org/1999/xhtml">
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top><head runat="server">
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <title></title>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top></head>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top><body>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <form id="form1" runat="server">
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <div>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <table cellpadding="0" cellspacing="0" border="0" width="60%" style="font-size: 11px">
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <tr>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <td align="center">
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:GridView ID="GridView1" runat="server" Width="100%" CellPadding="4" ForeColor="#333333"
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> AutoGenerateColumns="False" AllowPaging="True" PageSize="12" BorderColor="Silver"
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> BorderStyle="Solid" BorderWidth="1px" OnRowDataBound="GridView1_RowDataBound">
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <Columns>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:BoundField HeaderText="编号" DataField="id" Visible="false" />
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:TemplateField HeaderText="多选">
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <ItemTemplate>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <input type="checkbox" id="checkboxname" name="checkboxname" value='<%# DataBinder.Eval(Container.DataItem, "id")%>' />
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </ItemTemplate>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </asp:TemplateField>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:TemplateField HeaderText="单选">
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <ItemTemplate>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <input type="radio" id="RadioName" name="RadioName" value='<%# DataBinder.Eval(Container.DataItem, "id")%>'/>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </ItemTemplate>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </asp:TemplateField>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:BoundField HeaderText="姓名" DataField="name" />
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:BoundField HeaderText="身份证号" DataField="card" />
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:BoundField HeaderText="建立时间" DataField="createdate" />
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </Columns>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <PagerSettings Visible="False" />
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </asp:GridView>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </td>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </tr>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <tr>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <td align="center" style="height: 25px">
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:LinkButton ID="btnFirst" CommandArgument="first" OnClick="PagerButtonClick"
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> runat="server">首 页</asp:LinkButton>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:LinkButton ID="btnPrev" CommandArgument="prev" OnClick="PagerButtonClick" runat="server">上一页</asp:LinkButton>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:LinkButton ID="btnNext" CommandArgument="next" OnClick="PagerButtonClick" runat="server">下一页</asp:LinkButton>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:LinkButton ID="btnLast" CommandArgument="last" OnClick="PagerButtonClick" runat="server">尾 页</asp:LinkButton>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:Label ID="LblCurrentIndex" runat="server"></asp:Label>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:Label ID="LblPageCount" runat="server"></asp:Label>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:Label ID="LblRecordCount" runat="server"></asp:Label>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:Label ID="LblNoRecord" runat="server" Text="记录为零" Visible="False"></asp:Label></td>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </tr>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <tr>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <td>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <input type="button" value="全部选中" onclick="QuanXuan_Click()" />
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <input type="button" value="取消选中" onclick="QuXiao_Click()" />
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:Button ID="Button2" runat="server" Text="checkbox得到选择的行" OnClick="Button2_Click"></asp:Button>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> <asp:Button id="Button1" runat="server" Text="radio得到选择的行" OnClick="Button1_Click"></asp:Button>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </td>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </tr>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </table>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </div>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> </form>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top></body>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top></html>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>

fenpage.aspx.cs的代码:

0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>using System;
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>using System.Data;
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>using System.Configuration;
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>using System.Collections;
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>using System.Web;
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>using System.Web.Security;
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>using System.Web.UI;
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>using System.Web.UI.WebControls;
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>using System.Web.UI.WebControls.WebParts;
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>using System.Web.UI.HtmlControls;
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>using System.Data.SqlClient;
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>public partial class gridview_fenpage : System.Web.UI.Page
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>

数据库中表的生成代码:

0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>CREATE TABLE [dbo].[test01] (
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> [id] [decimal](18, 0) IDENTITY (1, 1) NOT NULL ,
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> [name] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> [card] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> [createdate] [datetime] NULL
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>) ON [PRIMARY]
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>GO
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>ALTER TABLE [dbo].[test01] ADD
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> CONSTRAINT [DF_test01_createdate] DEFAULT (getdate()) FOR [createdate],
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> CONSTRAINT [PK_test01] PRIMARY KEY CLUSTERED
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> (
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> [id]
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top> ) ON [PRIMARY]
0 && image.height>0){if(image.width>=510){this.width=510;this.height=image.height*510/image.width;}}" align=top>GO

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐