void Grid_RowsChanging(object sender, GridViewCollectionChangingEventArgs e) { if (e.Action == Telerik.WinControls.Data.NotifyCollectionChangedAction.Remove) { objMaster = new CustomerBO(); try { objMaster.GetByPrimaryKey(grdLister.CurrentRow.Cells["Id"].Value.ToInt()); objMaster.Delete(objMaster.Current); PopulateData(); } catch (Exception ex) { if (objMaster.Errors.Count > 0) { ENUtils.ShowMessage(objMaster.ShowErrors()); } else { ENUtils.ShowMessage(ex.Message); } e.Cancel = true; } } }
private void btnDelete_Click(object sender, EventArgs e) { DialogResult dr = MessageBox.Show("Müşterinin kaydını silmek istediğinizden emin misiniz?", "SİL", MessageBoxButtons.YesNo); if (dr == DialogResult.Yes) { bo.Delete(SelectedId); MessageBox.Show("Müşteri silindi"); } RefreshCustomers(); dgvViewSetting(dataGridView1); }