1.为按钮添加确认对话框Button1.Attributes.Add("onclick","return confirm(’确认?’)");button.attributes.add("onclick","if(confirm(’are you sure?’)){return true;}else{return false;}")2.删除表格选定记录//获得DataGrid主键int intEmpID = (int)MyDataGrid.DataKeys[e.Item.ItemIndex];string deleteCmd = "DELETE from Employee where emp_id = " + intEmpID.ToString(); 3.删除表格记录警告private void DataGrid_ItemCreated(Object sender,DataGridItemEventArgs e) 相关文章: 2022-12-23 2021-10-04 2021-08-13 2022-12-23 2022-03-03 2021-09-14