private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { int row = e.RowIndex; if (row > -1) { string id = dataGridView1.Rows[row].Cells[1].Value.ToString(); deleteVrification del = new deleteVrification(id, "4", ""); del.Show(); } }
private void listGrid_CellClick(object sender, DataGridViewCellEventArgs e) { try { int count = this.listGrid.Rows.Count; for (int i = 0; i < count; i++) { this.listGrid.Rows[i].Selected = false; } int column = e.ColumnIndex; int row = e.RowIndex; if (row > -1) { this.listGrid.Rows[row].Selected = true; } if (listGrid.Columns[column].Name == "deleteItem") { string id = this.listGrid.Rows[row].Cells["codegrid"].Value.ToString(); deleteVrification del = new deleteVrification(id, "2", System.Environment.MachineName); del.Show(); } else { phone.Text = this.listGrid.Rows[row].Cells["phones"].Value.ToString().Substring(0, this.listGrid.Rows[row].Cells["phones"].Value.ToString().Length - 1); if (listGrid.Columns[column].Name == "checkbox") { if (this.listGrid.Rows[row].Cells["checkbox"].EditedFormattedValue.ToString() == "False") { GlobalVariable.temporaryOwnList = GlobalVariable.temporaryOwnList + this.listGrid.Rows[row].Cells["codegrid"].Value.ToString() + ","; } else { List <string> lst = GlobalVariable.temporaryOwnList.Split(',').ToList(); lst.RemoveAt(lst.Count() - 1); lst.Remove(this.listGrid.Rows[row].Cells["codegrid"].Value.ToString()); GlobalVariable.temporaryOwnList = ""; foreach (var item in lst) { GlobalVariable.temporaryOwnList = GlobalVariable.temporaryOwnList + item + ","; } } } } } catch (Exception error) { } }
private void button1_Click(object sender, EventArgs e) { deleteVrification del = new deleteVrification(ID.Text, "1", ""); del.Show(); }