protected void RadGrid1_OnDeleteCommand(object sender, GridCommandEventArgs e) { newValue = new Hashtable(); editableItem = e.Item as GridEditableItem; e.Item.OwnerTableView.ExtractValuesFromItem(newValue, editableItem); var presenter = new PMCT_HDDV(this); //ID_Hang = int.Parse(DataBinder.Eval(e.Item.DataItem, "ID_Hang").ToString()); GridDataItem item = (GridDataItem)e.Item; ID_Hang = Convert.ToInt32(item.GetDataKeyValue("ID_Hang").ToString()); Message = presenter.Delete() ? "Xóa xong" : "Không xóa được nè"; if (Message == "Xóa xong") { RadGrid1.DataBind(); } }
protected void RadGrid2_OnDeleteCommand(object sender, GridCommandEventArgs e) { newValue = new Hashtable(); editableItem = e.Item as GridEditableItem; e.Item.OwnerTableView.ExtractValuesFromItem(newValue, editableItem); var presenter = new PMCT_HDDV(this); GridDataItem item = e.Item as GridDataItem; // get value from DataKey string str1 = item.GetDataKeyValue("ID_Hang").ToString(); ID_HoaDon = GlobleIdHoaDon; ID_Hang = int.Parse(str1); Message = presenter.Delete() ? "Xóa xong" : "Không xóa được nè"; if (Message == "Xóa xong") { RadGrid1.DataBind(); RadGrid1.Rebind(); RadGrid2.Rebind(); } }