当前位置: 首页 > 图文教程 > 网络编程 > ASP.NET > 实现自定义分页(如:改变传统datagrid的分页显示、通过A-Z的字母来分页等)、选择...

ASP.NET
ASP.NET实现数据图表a
ASP.NET实现数据图表1
Kbuilder.cs GIVE ME K
WebForm1.aspx K LINE YISHI GIEVE ME
ASP.NET实现数据图表b
today study 2005.03.03
ActiveX 组件复习笔记.1
Direct3D学习笔记(二)我们这里可以编写一个完全意义上的Direct3D程序了。
HttpContext类包含了个别HTTP请求的所有特定HTTP信息。
实现自定义分页(如:改变传统datagrid的分页显示、通过A-Z的字母来分页等)、选择...
关于Format字符串和Xml文件的解析(粗略)
wrox asp.net 2 beta preview study section 3
整合重复代码,生成自定义的列(组件)整合重复代码,生成自定义的datagrid(组件...
递归法提升密码穷举算法性能
如何用UltraEdit编译C#源程序
添加删除、更新按钮的提示确认信息,以及DATAGRID的添加、插入、更新、删除操作。
WebBrowser应用
My Composite in C#
DBForm的设计来源以及主要构想
.net中交易处理的解决方案

ASP.NET 中的 实现自定义分页(如:改变传统datagrid的分页显示、通过A-Z的字母来分页等)、选择...


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 49 ::
收藏到网摘: n/a

代码using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Drawing;using System.Web;using System.Web.SessionState;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.HtmlControls;namespace DataGridDemoCS{ /// /// Demo1 的摘要说明。 /// public class DemoFinal : System.Web.UI.Page { protected System.Data.SqlClient.SqlConnection sqlConnection1; protected System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1; //注意:dataset在编辑状态中将清空,所以可以将dataset申明为static,这样就可以保持dataset状态; //静态成员变量不可以用this来调用 protected DataGridDemoCS.dsCustomers dsCustomers1; protected DataGridDemoCS.dsCustomers.CustomersDataTable dsCustomerTable; protected DataGridDemoCS.dsCustomers.CustomersRow dsCustomerRow; protected System.Data.SqlClient.SqlCommand sqlSelectCommand1; protected System.Data.SqlClient.SqlCommand sqlInsertCommand1; protected System.Data.SqlClient.SqlCommand sqlUpdateCommand1; protected System.Data.SqlClient.SqlCommand sqlDeleteCommand1; protected System.Data.SqlClient.SqlConnection sqlConnection2; protected System.Web.UI.WebControls.Button Button1; protected System.Web.UI.WebControls.Button BtnInsertOneRow; protected System.Web.UI.WebControls.Button BtnDeleteGrouply; protected System.Web.UI.WebControls.Panel PnlPage; protected System.Data.DataView dv; protected System.Data.SqlClient.SqlDataAdapter sqlDataAdapter2; protected System.Data.SqlClient.SqlConnection sqlConnection3; protected System.Web.UI.WebControls.DataGrid DataGrid1; public int ExpandedItem=7; public Unit HostColumnWidth; private DataGrid detailsGrid; const string ExpandText = "+"; protected System.Data.SqlClient.SqlCommand sqlSelectCommand2; protected System.Data.SqlClient.SqlCommand sqlInsertCommand2; protected System.Data.SqlClient.SqlCommand sqlUpdateCommand2; protected System.Data.SqlClient.SqlCommand sqlDeleteCommand2; protected System.Web.UI.WebControls.Button Button2; const string CollapseText = "-"; private void Page_Load(object sender, System.EventArgs e) { // 在此处放置用户代码以初始化页面 if (!Page.IsPostBack) { ExpandedItem = -1; testWorkFlow=""; ViewState["Sort"]="CustomerID"; ViewState["orderby"]="asc"; bindDate(); BtnDeleteGrouply.Attributes.Add("OnClick","javascript:DeleteGrouply();"); HostColumnWidth = Unit.Pixel(150); } } void bindDate() { testWorkFlow=""; sqlDataAdapter1.Fill(dsCustomers1,"Customers"); if ((string)(ViewState["Sort"])!="") dv.Sort=(string)ViewState["Sort"]+" "+ViewState["orderby"]; else dsCustomers1.Customers.DefaultView.Sort="CustomerID"; if ((string)(ViewState["alpha"])!="") { dv.RowFilter="CustomerID LIKE '"+(string)(ViewState["alpha"])+"%'"; } DataGrid1.DataBind(); m_CreatePageTimes=0; } #region Web 窗体设计器生成的代码 override protected void OnInit(EventArgs e) { // // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。 // InitializeComponent(); base.OnInit(e); } /// /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// private void InitializeComponent() { this.sqlConnection1 = new System.Data.SqlClient.SqlConnection(); this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter(); this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand(); this.sqlConnection2 = new System.Data.SqlClient.SqlConnection(); this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand(); this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand(); this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand(); this.dsCustomers1 = new DataGridDemoCS.dsCustomers(); this.dv = new System.Data.DataView(); this.sqlDataAdapter2 = new System.Data.SqlClient.SqlDataAdapter(); this.sqlDeleteCommand2 = new System.Data.SqlClient.SqlCommand(); this.sqlConnection3 = new System.Data.SqlClient.SqlConnection(); this.sqlInsertCommand2 = new System.Data.SqlClient.SqlCommand(); this.sqlSelectCommand2 = new System.Data.SqlCl