Delete the line inside DataGrid, manually.

xiaoxiao2021-03-06  38

Private void page_load (object sender, system.eventargs e) {string isbuy = this.Request.QueryString.get ("isbuy"); string username = (string) session ["UserName"]; if (! this.ispostback) { This.DataGrid1.datasource = ProductManager.getProductListBYOWNAME (UserName, ISBUY); this.DataGrid1.database ();} // Place the user code here to initialize the page}

#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. /// private void InitializeComponent () {this.DataGrid1.ItemCommand = new System.Web.UI.WebControls.DataGridCommandEventHandler (this.ExcuteItemCommand); this.Load = new System.EventHandler (this.Page_Load) ;

} #Endregion

private void ExcuteItemCommand (object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) {if (e.CommandName == "del") {ProductManager.DeleteProduct (e.Item.Cells [0] .Text);

This.Response.Redirect (...);}}

// Basic ideas is to build a column that is not displayed.

// Get the text content of the current item based on this column

/ / Then delete

转载请注明原文地址:https://www.9cbs.com/read-51754.html

New Post(0)