private void DataGrid1_DeleteCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
int rowToDelete = e.Item.ItemIndex;
// Add code to delete row from data source.
DataGrid1.DataBind();
}private void DataGrid1_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
// The quantity is in the 7th column.
TableCell quantityCell = e.Item.Cells[6];
// The TextBox is the 0th element of the Controls collection.
TextBox quantityBox = (TextBox)quantityCell.Controls[0]; // Extract the quantity from the box.
int quantity = System.Int32.Parse(quantityBox.Text); // Use quantity to update the data source. // Switch out of edit mode.
DataGrid1.EditItemIndex = -1;
DataGrid1.DataBind();
}忘了问是winform还是webform
不过原理是一样的把
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
int rowToDelete = e.Item.ItemIndex;
// Add code to delete row from data source.
DataGrid1.DataBind();
}private void DataGrid1_UpdateCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
// The quantity is in the 7th column.
TableCell quantityCell = e.Item.Cells[6];
// The TextBox is the 0th element of the Controls collection.
TextBox quantityBox = (TextBox)quantityCell.Controls[0]; // Extract the quantity from the box.
int quantity = System.Int32.Parse(quantityBox.Text); // Use quantity to update the data source. // Switch out of edit mode.
DataGrid1.EditItemIndex = -1;
DataGrid1.DataBind();
}忘了问是winform还是webform
不过原理是一样的把
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货