headerstyle > <
FOOTERSTYLE Forecolor = "# 330099" Backcolor = "# fffcc"> footerStyle> pageerstyle> asp: datagrid> Form> body> html> Background CS file
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;
A summary description of Namespace WebApplication1 {/// /// WebForm1. /// summary> public class WebForm1: System.Web.UI.Page {internal System.Data.SqlClient.SqlDataAdapter sqlDataAdapter1; protected System.Data.SqlClient.SqlCommand sqlSelectCommand1; protected System.Data.SqlClient.SqlConnection sqlConnection1; protected WebApplication1.DataSet1 dataSet11; // protected GorthControls.GridSlideHeader GridSlideHeader1; // protected GorthControls.GridSlideHeader GridSlideHeader2; protected System.Web.UI.WebControls.DataGrid DataGrid1; private void Page_Load (object sender, System.EventArgs e) {// this Place the user code to initialize the page sqldataadapter1.fill (this.DataSet11); this.dataGrid1.datasource = this.dataSet11.tables [0]; this.database.database.DataBind (); this.dataGrid1.attributes.add ("OnSelectStart", " Return false "); this.dataGrid1.attributes.add (" onMouseDown "," f_mdown (this) "); this.dataGrid1.attributes.add (" onmousemove "," f_move (this) ");}
#Region Web Form Designer Generated Code Override Protected Void OnNit (Eventargs E) {// // Codegen: This call is required for the ASP.NET Web Form Designer. // InitializeComponent (); base.onit (e);} /// /// Designer Supports the required method - Do not use the code editor to modify the // / this method.
/// summary> private void InitializeComponent () {this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter (); this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand (); this.sqlConnection1 = new System. Data.SqlClient.SqlConnection (); this.dataSet11 = new WebApplication1.DataSet1 ();. ((System.ComponentModel.ISupportInitialize) (this.dataSet11)) BeginInit (); // // sqlDataAdapter1 // this.sqlDataAdapter1.SelectCommand = this.sqlSelectCommand1; this.sqlDataAdapter1.TableMappings.AddRange (new System.Data.Common.DataTableMapping [] {new System.Data.Common.DataTableMapping ( "Table", "Categories", new System.Data.Common.DataColumnMapping [ ] {New system.data.common.datacolumnMapping ("categoryid", "categoryid"), new system.data.common.datacolumnmapping ("categoryName", "categoryName", new System.Data.Common.DataColumnMapping ( "Description", "Description"), new System.Data.Common.DataColumnMapping ( "Picture", "Picture")})}); // // sqlSelectCommand1 // this.sqlSelectCommand1 .CommandText = "SELECT TOP 1 CategoryID, CategoryName, Description, Picture FROM Categories"; this.sqlSelectCommand1.Connection = this.sqlConnection1; // // sqlConnection1 // this.sqlConnection1.ConnectionString = "workstation id = /" STAR-NICK / "; packet size = 4096; user ID = sa; data source = /" (local) / "; pers"
"iSt security info = false; initial catalog = northwind; pwd = sa;"; // // dataset11 // this.dataset11.datasetName = "dataset1"; this.dataset11.locale = new system.globalization.cultureInfo ("zh -Cn "); this.Load = new system.EventHandler (this.page_load); (this.DataSet11)). Endinit ();} #ENDREGON}}
Scripted file: / ** *
Title: DataGrid Drag (with the header, do not refresh page) p> *
description: implement DataGrid Drag on the page (with the header, do not refresh the page p> *
Copyright: 2005-2005 by mail_ricklee corporation p> *
company: mail_ricklee corporation p> *
CreateTime: 2005-04-17 21:30 P > *
modifytime: p> * @createauthor Li Wei * @version 1.0 * @ModifyAuthor * @version 1.0 * /