private void btnDelete_Click(object sender, EventArgs e) { if (grv.RowCount > 0) { for (int i = 0; i < grv.SelectedRowsCount; i++) { if (grv.GetSelectedRows()[i] >= 0) { int x = Convert.ToInt32(grv.GetSelectedRows()[i]); int id = Convert.ToInt32(grv.GetRowCellValue(x, colPID)); sc = new wrProducts.Server2Client(); prd = new wrProducts.wsProducts(); sc = prd.deleteProduct(id); if (sc.Message != null) { XtraMessageBox.Show(sc.Message); } } } lueCAT_EditValueChanged(null, null); } else { XtraMessageBox.Show("Nothing to delete"); } }